I suspect we don't need those in the build system, at least for now (I actually checked,
of course :-) +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32736 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Master include file for the Media Kit.
|
||||
*
|
||||
*/
|
||||
#include <Buffer.h>
|
||||
#include <BufferConsumer.h>
|
||||
#include <BufferGroup.h>
|
||||
#include <BufferProducer.h>
|
||||
#include <Controllable.h>
|
||||
#include <FileInterface.h>
|
||||
#include <MediaAddOn.h>
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaEventLooper.h>
|
||||
#include <MediaFile.h>
|
||||
#include <MediaFiles.h>
|
||||
#include <MediaFormats.h>
|
||||
#include <MediaNode.h>
|
||||
#include <MediaRoster.h>
|
||||
#include <MediaTheme.h>
|
||||
#include <MediaTrack.h>
|
||||
#include <ParameterWeb.h>
|
||||
#include <PlaySound.h>
|
||||
#include <RealtimeAlloc.h>
|
||||
#include <Sound.h>
|
||||
#include <SoundFile.h>
|
||||
#include <SoundPlayer.h>
|
||||
#include <TimeCode.h>
|
||||
#include <TimeSource.h>
|
||||
#include <TimedEventQueue.h>
|
||||
@@ -1,108 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: Buffer.h
|
||||
/
|
||||
/ Description: A BBuffer is a container of media data in the Media Kit
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_BUFFER_H)
|
||||
#define _BUFFER_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
|
||||
|
||||
/*** A BBuffer is not the same thing as the area segment that gets cloned ***/
|
||||
/*** For each buffer that gets created, a BBuffer object is created to represent ***/
|
||||
/*** it in each participant address space. ***/
|
||||
|
||||
|
||||
struct _shared_buffer_list;
|
||||
|
||||
struct buffer_clone_info {
|
||||
buffer_clone_info();
|
||||
~buffer_clone_info();
|
||||
media_buffer_id buffer;
|
||||
area_id area;
|
||||
size_t offset;
|
||||
size_t size;
|
||||
int32 flags;
|
||||
private:
|
||||
uint32 _reserved_[4];
|
||||
};
|
||||
|
||||
|
||||
class BBuffer
|
||||
{
|
||||
public:
|
||||
|
||||
void * Data(); /* returns NULL if buffer not correctly initialized */
|
||||
size_t SizeAvailable(); // total size of buffer (how much data can it hold)
|
||||
size_t SizeUsed(); // how much was written (how much data does it hold)
|
||||
void SetSizeUsed(
|
||||
size_t size_used);
|
||||
uint32 Flags();
|
||||
|
||||
void Recycle();
|
||||
buffer_clone_info CloneInfo() const;
|
||||
|
||||
media_buffer_id ID(); /* 0 if not registered */
|
||||
media_type Type();
|
||||
media_header * Header();
|
||||
media_audio_header * AudioHeader();
|
||||
media_video_header * VideoHeader();
|
||||
|
||||
enum { /* for flags */
|
||||
B_F1_BUFFER = 0x1,
|
||||
B_F2_BUFFER = 0x2,
|
||||
B_SMALL_BUFFER = 0x80000000
|
||||
};
|
||||
|
||||
size_t Size(); // deprecated; use SizeAvailable()
|
||||
|
||||
private:
|
||||
|
||||
friend struct _buffer_id_cache;
|
||||
friend struct _shared_buffer_list;
|
||||
friend class BMediaRoster;
|
||||
friend class BBufferProducer;
|
||||
friend class BBufferConsumer; /* for buffer receiving */
|
||||
friend class BBufferGroup;
|
||||
friend class BSmallBuffer;
|
||||
|
||||
explicit BBuffer(const buffer_clone_info & info);
|
||||
~BBuffer(); /* BBuffer is NOT a virtual class!!! */
|
||||
|
||||
BBuffer(); /* not implemented */
|
||||
BBuffer(const BBuffer & clone); /* not implemented */
|
||||
BBuffer & operator=(const BBuffer & clone); /* not implemented */
|
||||
|
||||
void SetHeader(const media_header *header);
|
||||
|
||||
media_header fMediaHeader;
|
||||
_shared_buffer_list * fBufferList;
|
||||
area_id fArea;
|
||||
void * fData;
|
||||
size_t fOffset;
|
||||
size_t fSize;
|
||||
media_buffer_id fBufferID;
|
||||
int32 fFlags;
|
||||
|
||||
uint32 _reserved_buffer_[11];
|
||||
|
||||
};
|
||||
|
||||
|
||||
class BSmallBuffer : public BBuffer
|
||||
{
|
||||
public:
|
||||
BSmallBuffer();
|
||||
|
||||
static size_t SmallBufferSizeLimit();
|
||||
|
||||
};
|
||||
|
||||
#endif /* _BUFFER_H */
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: BufferConsumer.h
|
||||
/
|
||||
/ Description: A BBufferConsumer is anything that wants to receive buffers in the Media Kit
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_BUFFER_CONSUMER_H)
|
||||
#define _BUFFER_CONSUMER_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaNode.h>
|
||||
|
||||
namespace BPrivate { namespace media {
|
||||
class BMediaRosterEx;
|
||||
}}
|
||||
|
||||
class _buffer_id_cache;
|
||||
|
||||
class BBufferConsumer :
|
||||
public virtual BMediaNode
|
||||
{
|
||||
protected:
|
||||
/* this has to be at the top to force a vtable */
|
||||
virtual ~BBufferConsumer();
|
||||
|
||||
public:
|
||||
|
||||
media_type ConsumerType();
|
||||
|
||||
/* for encoding a region into the format needed for clipping requests */
|
||||
static status_t RegionToClipData(
|
||||
const BRegion * region,
|
||||
int32 * format,
|
||||
int32 * ioSize,
|
||||
void * data);
|
||||
|
||||
protected:
|
||||
explicit BBufferConsumer(
|
||||
media_type consumer_type /* = B_MEDIA_UNKNOWN_TYPE */);
|
||||
|
||||
static void NotifyLateProducer(
|
||||
const media_source & what_source,
|
||||
bigtime_t how_much,
|
||||
bigtime_t performance_time);
|
||||
status_t SetVideoClippingFor(
|
||||
const media_source & output,
|
||||
const media_destination & destination,
|
||||
const int16 * shorts,
|
||||
int32 short_count,
|
||||
const media_video_display_info & display,
|
||||
void * user_data,
|
||||
int32 * change_tag,
|
||||
void * _reserved_ = 0); // change_tag value will be passed to RequestCompleted()
|
||||
status_t SetOutputEnabled(
|
||||
const media_source & source,
|
||||
const media_destination & destination,
|
||||
bool enabled,
|
||||
void * user_data,
|
||||
int32 * change_tag,
|
||||
void * _reserved_ = 0); // change_tag value will be passed to RequestCompleted()
|
||||
status_t RequestFormatChange(
|
||||
const media_source & source,
|
||||
const media_destination & destination,
|
||||
const media_format & to_format,
|
||||
void * user_data,
|
||||
int32 * change_tag,
|
||||
void * _reserved_ = 0); // change_tag value will be passed to RequestCompleted()
|
||||
status_t RequestAdditionalBuffer( // new in 4.1
|
||||
const media_source & source,
|
||||
BBuffer * prev_buffer,
|
||||
void * _reserved = NULL);
|
||||
status_t RequestAdditionalBuffer( // new in 4.1
|
||||
const media_source & source,
|
||||
bigtime_t start_time,
|
||||
void * _reserved = NULL);
|
||||
status_t SetOutputBuffersFor( // new in 4.1
|
||||
const media_source & source,
|
||||
const media_destination & destination,
|
||||
BBufferGroup * group,
|
||||
void * user_data,
|
||||
int32 * change_tag, // passed to RequestCompleted()
|
||||
bool will_reclaim = false,
|
||||
void * _reserved_ = 0);
|
||||
status_t SendLatencyChange(
|
||||
const media_source & source,
|
||||
const media_destination & destination,
|
||||
bigtime_t my_new_latency,
|
||||
uint32 flags = 0);
|
||||
|
||||
protected:
|
||||
|
||||
virtual status_t HandleMessage(
|
||||
int32 message,
|
||||
const void * data,
|
||||
size_t size);
|
||||
|
||||
/* Someone, probably the producer, is asking you about this format. Give */
|
||||
/* your honest opinion, possibly modifying *format. Do not ask upstream */
|
||||
/* producer about the format, since he's synchronously waiting for your */
|
||||
/* reply. */
|
||||
virtual status_t AcceptFormat(
|
||||
const media_destination & dest,
|
||||
media_format * ioFormat) = 0;
|
||||
virtual status_t GetNextInput(
|
||||
int32 * cookie,
|
||||
media_input * out_input) = 0;
|
||||
virtual void DisposeInputCookie(
|
||||
int32 cookie) = 0;
|
||||
virtual void BufferReceived(
|
||||
BBuffer * buffer) = 0;
|
||||
virtual void ProducerDataStatus(
|
||||
const media_destination & for_whom,
|
||||
int32 status,
|
||||
bigtime_t at_performance_time) = 0;
|
||||
virtual status_t GetLatencyFor(
|
||||
const media_destination & for_whom,
|
||||
bigtime_t * out_latency,
|
||||
media_node_id * out_timesource) = 0;
|
||||
virtual status_t Connected(
|
||||
const media_source & producer, /* here's a good place to request buffer group usage */
|
||||
const media_destination & where,
|
||||
const media_format & with_format,
|
||||
media_input * out_input) = 0;
|
||||
virtual void Disconnected(
|
||||
const media_source & producer,
|
||||
const media_destination & where) = 0;
|
||||
/* The notification comes from the upstream producer, so he's already cool with */
|
||||
/* the format; you should not ask him about it in here. */
|
||||
virtual status_t FormatChanged(
|
||||
const media_source & producer,
|
||||
const media_destination & consumer,
|
||||
int32 change_tag,
|
||||
const media_format & format) = 0;
|
||||
|
||||
/* Given a performance time of some previous buffer, retrieve the remembered tag */
|
||||
/* of the closest (previous or exact) performance time. Set *out_flags to 0; the */
|
||||
/* idea being that flags can be added later, and the understood flags returned in */
|
||||
/* *out_flags. */
|
||||
virtual status_t SeekTagRequested(
|
||||
const media_destination & destination,
|
||||
bigtime_t in_target_time,
|
||||
uint32 in_flags,
|
||||
media_seek_tag * out_seek_tag,
|
||||
bigtime_t * out_tagged_time,
|
||||
uint32 * out_flags);
|
||||
|
||||
private:
|
||||
|
||||
BBufferConsumer(); /* private unimplemented */
|
||||
BBufferConsumer(
|
||||
const BBufferConsumer & clone);
|
||||
BBufferConsumer & operator=(
|
||||
const BBufferConsumer & clone);
|
||||
|
||||
// these functions are deprecated from the 4.0 API
|
||||
static status_t SetVideoClippingFor(
|
||||
const media_source & output,
|
||||
const int16 * shorts,
|
||||
int32 short_count,
|
||||
const media_video_display_info & display,
|
||||
int32 * change_tag); // change_tag value will be passed to RequestCompleted()
|
||||
static status_t RequestFormatChange(
|
||||
const media_source & source,
|
||||
const media_destination & destination,
|
||||
media_format * io_to_format, // the "o" part is unused from 4.1
|
||||
int32 * change_tag); // change_tag value will be passed to RequestCompleted()
|
||||
static status_t SetOutputEnabled(
|
||||
const media_source & source,
|
||||
bool enabled,
|
||||
int32 * change_tag); // change_tag value will be passed to RequestCompleted()
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
status_t _Reserved_BufferConsumer_0(void *); /* SeekTagRequested */
|
||||
virtual status_t _Reserved_BufferConsumer_1(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_2(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_3(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_4(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_5(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_6(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_7(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_8(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_9(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_10(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_11(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_12(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_13(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_14(void *);
|
||||
virtual status_t _Reserved_BufferConsumer_15(void *);
|
||||
|
||||
friend class BMediaNode;
|
||||
friend class BBufferProducer;
|
||||
friend class BMediaRoster;
|
||||
friend class BPrivate::media::BMediaRosterEx;
|
||||
|
||||
media_type fConsumerType;
|
||||
_buffer_id_cache * fBufferCache;
|
||||
BBufferGroup *fDeleteBufferGroup;
|
||||
uint32 _reserved_buffer_consumer_[14];
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* _BUFFER_CONSUMER_H */
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: BufferGroup.h
|
||||
/
|
||||
/ Description: A BBufferGroup organizes sets of BBuffers so that you can request
|
||||
/ and reclaim them.
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_BUFFER_GROUP_H)
|
||||
#define _BUFFER_GROUP_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
|
||||
struct _shared_buffer_list;
|
||||
|
||||
class BBufferGroup
|
||||
{
|
||||
public:
|
||||
|
||||
BBufferGroup(
|
||||
size_t size,
|
||||
int32 count = 3,
|
||||
uint32 placement = B_ANY_ADDRESS,
|
||||
uint32 lock = B_FULL_LOCK);
|
||||
explicit BBufferGroup();
|
||||
BBufferGroup(
|
||||
int32 count,
|
||||
const media_buffer_id * buffers);
|
||||
~BBufferGroup(); /* BBufferGroup is NOT a virtual class!!! */
|
||||
|
||||
status_t InitCheck();
|
||||
|
||||
/* use this function to add buffers you created on your own */
|
||||
status_t AddBuffer(
|
||||
const buffer_clone_info & info,
|
||||
BBuffer ** out_buffer = NULL);
|
||||
|
||||
BBuffer * RequestBuffer(
|
||||
size_t size,
|
||||
bigtime_t timeout = B_INFINITE_TIMEOUT);
|
||||
status_t RequestBuffer(
|
||||
BBuffer * buffer,
|
||||
bigtime_t timeout = B_INFINITE_TIMEOUT);
|
||||
status_t RequestError(); /* return last RequestBuffer error, useful if NULL is returned */
|
||||
|
||||
status_t CountBuffers(
|
||||
int32 * out_count);
|
||||
status_t GetBufferList(
|
||||
int32 buf_count,
|
||||
BBuffer ** out_buffers);
|
||||
|
||||
status_t WaitForBuffers();
|
||||
status_t ReclaimAllBuffers();
|
||||
|
||||
private:
|
||||
/* in BeOS R5 this is a deprecated api, from BeOS R4 times */
|
||||
status_t AddBuffersTo(BMessage * message, const char * name, bool needLock=true);
|
||||
|
||||
status_t InitBufferGroup(); /* used internally */
|
||||
BBufferGroup(const BBufferGroup &); /* not implemented */
|
||||
BBufferGroup& operator=(const BBufferGroup&); /* not implemented */
|
||||
|
||||
friend struct _shared_buffer_list;
|
||||
|
||||
status_t fInitError;
|
||||
status_t fRequestError;
|
||||
int32 fBufferCount;
|
||||
_shared_buffer_list * fBufferList;
|
||||
|
||||
// this is a BBufferGroup specific semaphore used for reclaiming BBuffers of this group
|
||||
// is also is a system wide unique identifier of this group
|
||||
sem_id fReclaimSem;
|
||||
|
||||
uint32 _reserved_buffer_group_[9];
|
||||
};
|
||||
|
||||
#endif /* _BUFFER_GROUP_H */
|
||||
|
||||
@@ -1,245 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: BBufferProducer.h
|
||||
/
|
||||
/ Description: A BBufferProducer is any source of media buffers in the Media Kit
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_BUFFER_PRODUCER_H)
|
||||
#define _BUFFER_PRODUCER_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaNode.h>
|
||||
|
||||
namespace BPrivate { namespace media {
|
||||
class BMediaRosterEx;
|
||||
}}
|
||||
|
||||
|
||||
class BBufferProducer :
|
||||
public virtual BMediaNode
|
||||
{
|
||||
protected:
|
||||
/* this has to be at the top to force a vtable */
|
||||
virtual ~BBufferProducer();
|
||||
|
||||
public:
|
||||
|
||||
/* Supported formats for low-level clipping data */
|
||||
enum {
|
||||
B_CLIP_SHORT_RUNS = 1
|
||||
};
|
||||
|
||||
/* Handy conversion functions for dealing with clip information */
|
||||
static status_t ClipDataToRegion(
|
||||
int32 format,
|
||||
int32 size,
|
||||
const void * data,
|
||||
BRegion * region);
|
||||
|
||||
media_type ProducerType();
|
||||
|
||||
protected:
|
||||
explicit BBufferProducer(
|
||||
media_type producer_type /* = B_MEDIA_UNKNOWN_TYPE */);
|
||||
|
||||
enum suggestion_quality {
|
||||
B_ANY_QUALITY = 0,
|
||||
B_LOW_QUALITY = 10,
|
||||
B_MEDIUM_QUALITY = 50,
|
||||
B_HIGH_QUALITY = 100
|
||||
};
|
||||
|
||||
/* functionality of BBufferProducer */
|
||||
virtual status_t FormatSuggestionRequested(
|
||||
media_type type,
|
||||
int32 quality,
|
||||
media_format * format) = 0;
|
||||
virtual status_t FormatProposal(
|
||||
const media_source & output,
|
||||
media_format * ioFormat) = 0;
|
||||
/* If the format isn't good, put a good format into *io_format and return error */
|
||||
/* If format has wildcard, specialize to what you can do (and change). */
|
||||
/* If you can change the format, return OK. */
|
||||
/* The request comes from your destination sychronously, so you cannot ask it */
|
||||
/* whether it likes it -- you should assume it will since it asked. */
|
||||
virtual status_t FormatChangeRequested(
|
||||
const media_source & source,
|
||||
const media_destination & destination,
|
||||
media_format * io_format,
|
||||
int32 * _deprecated_) = 0;
|
||||
virtual status_t GetNextOutput( /* cookie starts as 0 */
|
||||
int32 * cookie,
|
||||
media_output * out_output) = 0;
|
||||
virtual status_t DisposeOutputCookie(
|
||||
int32 cookie) = 0;
|
||||
/* In this function, you should either pass on the group to your upstream guy, */
|
||||
/* or delete your current group and hang on to this group. Deleting the previous */
|
||||
/* group (unless you passed it on with the reclaim flag set to false) is very */
|
||||
/* important, else you will 1) leak memory and 2) block someone who may want */
|
||||
/* to reclaim the buffers living in that group. */
|
||||
virtual status_t SetBufferGroup(
|
||||
const media_source & for_source,
|
||||
BBufferGroup * group) = 0;
|
||||
/* Format of clipping is (as int16-s): <from line> <npairs> <startclip> <endclip>. */
|
||||
/* Repeat for each line where the clipping is different from the previous line. */
|
||||
/* If <npairs> is negative, use the data from line -<npairs> (there are 0 pairs after */
|
||||
/* a negative <npairs>. Yes, we only support 32k*32k frame buffers for clipping. */
|
||||
/* Any non-0 field of 'display' means that that field changed, and if you don't support */
|
||||
/* that change, you should return an error and ignore the request. Note that the buffer */
|
||||
/* offset values do not have wildcards; 0 (or -1, or whatever) are real values and must */
|
||||
/* be adhered to. */
|
||||
virtual status_t VideoClippingChanged(
|
||||
const media_source & for_source,
|
||||
int16 num_shorts,
|
||||
int16 * clip_data,
|
||||
const media_video_display_info & display,
|
||||
int32 * _deprecated_);
|
||||
/* Iterates over all outputs and maxes the latency found */
|
||||
virtual status_t GetLatency(
|
||||
bigtime_t * out_lantency);
|
||||
virtual status_t PrepareToConnect(
|
||||
const media_source & what,
|
||||
const media_destination & where,
|
||||
media_format * format,
|
||||
media_source * out_source,
|
||||
char * out_name) = 0;
|
||||
virtual void Connect(
|
||||
status_t error,
|
||||
const media_source & source,
|
||||
const media_destination & destination,
|
||||
const media_format & format,
|
||||
char * io_name) = 0;
|
||||
virtual void Disconnect(
|
||||
const media_source & what,
|
||||
const media_destination & where) = 0;
|
||||
virtual void LateNoticeReceived(
|
||||
const media_source & what,
|
||||
bigtime_t how_much,
|
||||
bigtime_t performance_time) = 0;
|
||||
virtual void EnableOutput(
|
||||
const media_source & what,
|
||||
bool enabled,
|
||||
int32 * _deprecated_) = 0;
|
||||
virtual status_t SetPlayRate(
|
||||
int32 numer,
|
||||
int32 denom);
|
||||
|
||||
virtual status_t HandleMessage( /* call this from the thread that listens to the port */
|
||||
int32 message,
|
||||
const void * data,
|
||||
size_t size);
|
||||
|
||||
virtual void AdditionalBufferRequested( // used to be Reserved 0
|
||||
const media_source & source,
|
||||
media_buffer_id prev_buffer,
|
||||
bigtime_t prev_time,
|
||||
const media_seek_tag * prev_tag); // may be NULL
|
||||
|
||||
virtual void LatencyChanged( // used to be Reserved 1
|
||||
const media_source & source,
|
||||
const media_destination & destination,
|
||||
bigtime_t new_latency,
|
||||
uint32 flags);
|
||||
|
||||
/* Use this function in BBufferProducer to pass on the buffer. */
|
||||
status_t SendBuffer(
|
||||
BBuffer * buffer,
|
||||
const media_destination & destination);
|
||||
|
||||
status_t SendDataStatus(
|
||||
int32 status,
|
||||
const media_destination & destination,
|
||||
bigtime_t at_time);
|
||||
|
||||
/* Check in advance if a target is prepared to accept a format. You may */
|
||||
/* want to call this from Connect(), although that's not required. */
|
||||
status_t ProposeFormatChange(
|
||||
media_format * format,
|
||||
const media_destination & for_destination);
|
||||
/* Tell consumer to accept a proposed format change */
|
||||
/* YOU MUST NOT CALL BROADCAST_BUFFER WHILE THIS CALL IS OUTSTANDING! */
|
||||
status_t ChangeFormat(
|
||||
const media_source & for_source,
|
||||
const media_destination & for_destination,
|
||||
media_format * format);
|
||||
/* Check how much latency the down-stream graph introduces */
|
||||
status_t FindLatencyFor(
|
||||
const media_destination & for_destination,
|
||||
bigtime_t * out_latency,
|
||||
media_node_id * out_timesource);
|
||||
|
||||
/* Find the tag of a previously seen buffer to expedite seeking */
|
||||
status_t FindSeekTag(
|
||||
const media_destination & for_destination,
|
||||
bigtime_t in_target_time,
|
||||
media_seek_tag * out_tag,
|
||||
bigtime_t * out_tagged_time,
|
||||
uint32 * out_flags = 0,
|
||||
uint32 in_flags = 0);
|
||||
|
||||
/* Set the initial latency, which is the maximum additional latency */
|
||||
/* that will be imposed while starting/syncing to a signal (such as */
|
||||
/* starting a TV capture card in the middle of a field). Most nodes */
|
||||
/* have this at 0 (the default); only TV input Nodes need it currently */
|
||||
/* because they slave to a low-resolution (59.94 Hz) clock that arrives */
|
||||
/* from the outside world. Call this from the constructor if you need it. */
|
||||
void SetInitialLatency(
|
||||
bigtime_t inInitialLatency,
|
||||
uint32 flags = 0);
|
||||
|
||||
private:
|
||||
|
||||
friend class BBufferConsumer;
|
||||
friend class BMediaNode;
|
||||
friend class BMediaRoster;
|
||||
friend class BPrivate::media::BMediaRosterEx;
|
||||
|
||||
BBufferProducer(); /* private unimplemented */
|
||||
BBufferProducer(
|
||||
const BBufferProducer & clone);
|
||||
BBufferProducer & operator=(
|
||||
const BBufferProducer & clone);
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
status_t _Reserved_BufferProducer_0(void *); /* AdditionalBufferRequested() */
|
||||
status_t _Reserved_BufferProducer_1(void *); /* LatencyChanged() */
|
||||
virtual status_t _Reserved_BufferProducer_2(void *);
|
||||
virtual status_t _Reserved_BufferProducer_3(void *);
|
||||
virtual status_t _Reserved_BufferProducer_4(void *);
|
||||
virtual status_t _Reserved_BufferProducer_5(void *);
|
||||
virtual status_t _Reserved_BufferProducer_6(void *);
|
||||
virtual status_t _Reserved_BufferProducer_7(void *);
|
||||
virtual status_t _Reserved_BufferProducer_8(void *);
|
||||
virtual status_t _Reserved_BufferProducer_9(void *);
|
||||
virtual status_t _Reserved_BufferProducer_10(void *);
|
||||
virtual status_t _Reserved_BufferProducer_11(void *);
|
||||
virtual status_t _Reserved_BufferProducer_12(void *);
|
||||
virtual status_t _Reserved_BufferProducer_13(void *);
|
||||
virtual status_t _Reserved_BufferProducer_14(void *);
|
||||
virtual status_t _Reserved_BufferProducer_15(void *);
|
||||
|
||||
|
||||
media_type fProducerType;
|
||||
bigtime_t fInitialLatency;
|
||||
uint32 fInitialFlags;
|
||||
bigtime_t fDelay;
|
||||
|
||||
static status_t clip_shorts_to_region(
|
||||
const int16 * data,
|
||||
int count,
|
||||
BRegion * output);
|
||||
static status_t clip_region_to_shorts(
|
||||
const BRegion * input,
|
||||
int16 * data,
|
||||
int max_count,
|
||||
int * out_count);
|
||||
|
||||
uint32 _reserved_buffer_producer_[12];
|
||||
};
|
||||
|
||||
#endif /* _BUFFER_PRODUCER_H */
|
||||
|
||||
@@ -1,139 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: Controllable.h
|
||||
/
|
||||
/ Description: A BControllable is a BMediaNode with "tweakable" parameters/settings.
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_CONTROLLABLE_H)
|
||||
#define _CONTROLLABLE_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaNode.h>
|
||||
|
||||
class BParameterWeb;
|
||||
|
||||
|
||||
class BControllable :
|
||||
public virtual BMediaNode
|
||||
{
|
||||
protected:
|
||||
/* Need this to force vtable */
|
||||
virtual ~BControllable();
|
||||
|
||||
public:
|
||||
|
||||
/* BControllable might seem somewhat spartan. */
|
||||
|
||||
/* That is because control change requests and notifications */
|
||||
/* typically come in/go out in B_MEDIA_PARAMETERS type buffers */
|
||||
/* (and a BControllable thus also needs to be a BBufferConsumer */
|
||||
/* and/or a BBufferProducer) */
|
||||
/* The format of these buffers is: */
|
||||
/* media_node(node), int32(count) */
|
||||
/* repeat(count) { int64(when), int32(control_id), int32(value_size), <value> } */
|
||||
|
||||
BParameterWeb * Web();
|
||||
bool LockParameterWeb();
|
||||
void UnlockParameterWeb();
|
||||
|
||||
protected:
|
||||
|
||||
BControllable(); /* call SetParameterWeb() from your constructor */
|
||||
status_t SetParameterWeb(
|
||||
BParameterWeb * web);
|
||||
|
||||
virtual status_t HandleMessage(
|
||||
int32 message,
|
||||
const void * data,
|
||||
size_t size);
|
||||
|
||||
/* Call when the actual control changes, NOT when the value changes. */
|
||||
/* A typical case would be a CD with a Selector for Track when a new CD is inserted */
|
||||
status_t BroadcastChangedParameter(
|
||||
int32 id);
|
||||
|
||||
/* Call this function when a value change takes effect, and */
|
||||
/* you want people who are interested to stay in sync with you. */
|
||||
/* Don't call this too densely, though, or you will flood the system */
|
||||
/* with messages. */
|
||||
status_t BroadcastNewParameterValue(
|
||||
bigtime_t when, // performance time
|
||||
int32 id, // parameter ID
|
||||
void * newValue,
|
||||
size_t valueSize);
|
||||
|
||||
/* These are alternate methods of accomplishing the same thing as */
|
||||
/* connecting to control information source/destinations would. */
|
||||
virtual status_t GetParameterValue(
|
||||
int32 id,
|
||||
bigtime_t * last_change,
|
||||
void * value,
|
||||
size_t * ioSize) = 0;
|
||||
virtual void SetParameterValue(
|
||||
int32 id,
|
||||
bigtime_t when,
|
||||
const void * value,
|
||||
size_t size) = 0;
|
||||
|
||||
/* The default implementation of StartControlPanel launches the add-on */
|
||||
/* as an application (if the Node lives in an add-on). Thus, you can write your */
|
||||
/* control panel as a "main()" in your add-on, and it'll automagically work! */
|
||||
/* Your add-on needs to have multi-launch app flags for this to work right. */
|
||||
/* The first argv argument to main() will be a string of the format "node=%d" */
|
||||
/* with the node ID in question as "%d". */
|
||||
virtual status_t StartControlPanel(
|
||||
BMessenger * out_messenger);
|
||||
|
||||
/* Call this from your BufferReceived() for control information buffers */
|
||||
/* if you implement BBufferConsumer for that format (recommended!) */
|
||||
status_t ApplyParameterData(
|
||||
const void * value,
|
||||
size_t size);
|
||||
/* If you want to generate control information for a set of controls, you */
|
||||
/* can use this utility function. */
|
||||
status_t MakeParameterData(
|
||||
const int32 * controls,
|
||||
int32 count,
|
||||
void * buf,
|
||||
size_t * ioSize);
|
||||
|
||||
private:
|
||||
|
||||
friend class BMediaNode;
|
||||
|
||||
BControllable( /* private unimplemented */
|
||||
const BControllable & clone);
|
||||
BControllable & operator=(
|
||||
const BControllable & clone);
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_Controllable_0(void *);
|
||||
virtual status_t _Reserved_Controllable_1(void *);
|
||||
virtual status_t _Reserved_Controllable_2(void *);
|
||||
virtual status_t _Reserved_Controllable_3(void *);
|
||||
virtual status_t _Reserved_Controllable_4(void *);
|
||||
virtual status_t _Reserved_Controllable_5(void *);
|
||||
virtual status_t _Reserved_Controllable_6(void *);
|
||||
virtual status_t _Reserved_Controllable_7(void *);
|
||||
virtual status_t _Reserved_Controllable_8(void *);
|
||||
virtual status_t _Reserved_Controllable_9(void *);
|
||||
virtual status_t _Reserved_Controllable_10(void *);
|
||||
virtual status_t _Reserved_Controllable_11(void *);
|
||||
virtual status_t _Reserved_Controllable_12(void *);
|
||||
virtual status_t _Reserved_Controllable_13(void *);
|
||||
virtual status_t _Reserved_Controllable_14(void *);
|
||||
virtual status_t _Reserved_Controllable_15(void *);
|
||||
|
||||
BParameterWeb * fWeb;
|
||||
sem_id fSem;
|
||||
int32 fBen;
|
||||
uint32 _reserved_controllable_[14];
|
||||
};
|
||||
|
||||
|
||||
#endif /* _CONTROLLABLE_H */
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: FileInterface.h
|
||||
/
|
||||
/ Description: A BFileInterface is something which can read and/or write files for the
|
||||
/ use of other Media Kit participants.
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_FILE_INTERFACE_H)
|
||||
#define _FILE_INTERFACE_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaNode.h>
|
||||
|
||||
|
||||
class BFileInterface :
|
||||
public virtual BMediaNode
|
||||
{
|
||||
protected:
|
||||
|
||||
virtual ~BFileInterface(); /* force vtable */
|
||||
|
||||
public:
|
||||
|
||||
/* look, no hands! */
|
||||
|
||||
protected:
|
||||
|
||||
BFileInterface();
|
||||
virtual status_t HandleMessage(
|
||||
int32 message,
|
||||
const void * data,
|
||||
size_t size);
|
||||
|
||||
virtual status_t GetNextFileFormat(
|
||||
int32 * cookie,
|
||||
media_file_format * out_format) = 0;
|
||||
virtual void DisposeFileFormatCookie(
|
||||
int32 cookie) = 0;
|
||||
|
||||
virtual status_t GetDuration(
|
||||
bigtime_t * out_time) = 0;
|
||||
virtual status_t SniffRef(
|
||||
const entry_ref & file,
|
||||
char * out_mime_type, /* 256 bytes */
|
||||
float * out_quality) = 0;
|
||||
virtual status_t SetRef(
|
||||
const entry_ref & file,
|
||||
bool create,
|
||||
bigtime_t * out_time) = 0;
|
||||
virtual status_t GetRef(
|
||||
entry_ref * out_ref,
|
||||
char * out_mime_type) = 0;
|
||||
|
||||
private:
|
||||
|
||||
friend class BMediaNode;
|
||||
|
||||
BFileInterface( /* private unimplemented */
|
||||
const BFileInterface & clone);
|
||||
BFileInterface & operator=(
|
||||
const BFileInterface & clone);
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_FileInterface_0(void *);
|
||||
virtual status_t _Reserved_FileInterface_1(void *);
|
||||
virtual status_t _Reserved_FileInterface_2(void *);
|
||||
virtual status_t _Reserved_FileInterface_3(void *);
|
||||
virtual status_t _Reserved_FileInterface_4(void *);
|
||||
virtual status_t _Reserved_FileInterface_5(void *);
|
||||
virtual status_t _Reserved_FileInterface_6(void *);
|
||||
virtual status_t _Reserved_FileInterface_7(void *);
|
||||
virtual status_t _Reserved_FileInterface_8(void *);
|
||||
virtual status_t _Reserved_FileInterface_9(void *);
|
||||
virtual status_t _Reserved_FileInterface_10(void *);
|
||||
virtual status_t _Reserved_FileInterface_11(void *);
|
||||
virtual status_t _Reserved_FileInterface_12(void *);
|
||||
virtual status_t _Reserved_FileInterface_13(void *);
|
||||
virtual status_t _Reserved_FileInterface_14(void *);
|
||||
virtual status_t _Reserved_FileInterface_15(void *);
|
||||
|
||||
uint32 _reserved_file_interface_[16];
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* _FILE_INTERFACE_H */
|
||||
|
||||
@@ -1,178 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: MediaAddOn.h
|
||||
/
|
||||
/ Description: A BMediaAddOn is created by Media Kit add-ons to instantiate and
|
||||
/ handle "latent" Nodes.
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_MEDIA_ADD_ON_H)
|
||||
#define _MEDIA_ADD_ON_H
|
||||
|
||||
#include <image.h>
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <Flattenable.h>
|
||||
|
||||
|
||||
struct dormant_node_info {
|
||||
dormant_node_info();
|
||||
~dormant_node_info();
|
||||
|
||||
media_addon_id addon;
|
||||
int32 flavor_id;
|
||||
char name[B_MEDIA_NAME_LENGTH];
|
||||
private:
|
||||
char reserved[128];
|
||||
};
|
||||
|
||||
enum
|
||||
{ // flavor_flags
|
||||
B_FLAVOR_IS_GLOBAL = 0x100000L, // force in media_addon_server, only one instance
|
||||
B_FLAVOR_IS_LOCAL = 0x200000L // force in loading app, many instances
|
||||
// if none is set, could go either way
|
||||
};
|
||||
|
||||
struct flavor_info {
|
||||
char * name;
|
||||
char * info;
|
||||
uint64 kinds; /* node_kind */
|
||||
uint32 flavor_flags;
|
||||
int32 internal_id; /* For BMediaAddOn internal use */
|
||||
int32 possible_count; /* 0 for "any number" */
|
||||
|
||||
int32 in_format_count; /* for BufferConsumer kinds */
|
||||
uint32 in_format_flags; /* set to 0 */
|
||||
const media_format * in_formats;
|
||||
|
||||
int32 out_format_count; /* for BufferProducer kinds */
|
||||
uint32 out_format_flags; /* set to 0 */
|
||||
const media_format * out_formats;
|
||||
|
||||
uint32 _reserved_[16];
|
||||
|
||||
private:
|
||||
flavor_info & operator=(const flavor_info & other);
|
||||
};
|
||||
|
||||
struct dormant_flavor_info : public flavor_info, public BFlattenable {
|
||||
|
||||
dormant_flavor_info();
|
||||
virtual ~dormant_flavor_info();
|
||||
dormant_flavor_info(const dormant_flavor_info &);
|
||||
dormant_flavor_info& operator=(const dormant_flavor_info &);
|
||||
dormant_flavor_info& operator=(const flavor_info &);
|
||||
|
||||
dormant_node_info node_info;
|
||||
|
||||
void set_name(const char * in_name);
|
||||
void set_info(const char * in_info);
|
||||
void add_in_format(const media_format & in_format);
|
||||
void add_out_format(const media_format & out_format);
|
||||
|
||||
virtual bool IsFixedSize() const;
|
||||
virtual type_code TypeCode() const;
|
||||
virtual ssize_t FlattenedSize() const;
|
||||
virtual status_t Flatten(void *buffer, ssize_t size) const;
|
||||
virtual status_t Unflatten(type_code c, const void *buf, ssize_t size);
|
||||
};
|
||||
|
||||
namespace BPrivate {
|
||||
namespace media {
|
||||
class DormantNodeManager;
|
||||
};
|
||||
};
|
||||
|
||||
/* a MediaAddOn is something which can manufacture MediaNodes */
|
||||
class BMediaAddOn
|
||||
{
|
||||
public:
|
||||
explicit BMediaAddOn(
|
||||
image_id image);
|
||||
virtual ~BMediaAddOn();
|
||||
|
||||
virtual status_t InitCheck(
|
||||
const char ** out_failure_text);
|
||||
virtual int32 CountFlavors();
|
||||
virtual status_t GetFlavorAt(
|
||||
int32 n,
|
||||
const flavor_info ** out_info);
|
||||
virtual BMediaNode * InstantiateNodeFor(
|
||||
const flavor_info * info,
|
||||
BMessage * config,
|
||||
status_t * out_error);
|
||||
virtual status_t GetConfigurationFor(
|
||||
BMediaNode * your_node,
|
||||
BMessage * into_message);
|
||||
virtual bool WantsAutoStart();
|
||||
virtual status_t AutoStart(
|
||||
int in_index,
|
||||
BMediaNode ** out_node,
|
||||
int32 * out_internal_id,
|
||||
bool * out_has_more);
|
||||
/* only implement if you have a B_FILE_INTERFACE node */
|
||||
virtual status_t SniffRef(
|
||||
const entry_ref & file,
|
||||
BMimeType * io_mime_type,
|
||||
float * out_quality,
|
||||
int32 * out_internal_id);
|
||||
virtual status_t SniffType( // This is broken if you deal with producers
|
||||
const BMimeType & type, // and consumers both. Use SniffTypeKind instead.
|
||||
float * out_quality, // If you implement SniffTypeKind, this doesn't
|
||||
int32 * out_internal_id); // get called.
|
||||
virtual status_t GetFileFormatList(
|
||||
int32 flavor_id, // for this node flavor (if it matters)
|
||||
media_file_format * out_writable_formats, // don't write here if NULL
|
||||
int32 in_write_items, // this many slots in out_writable_formats
|
||||
int32 * out_write_items, // set this to actual # available, even if bigger than in count
|
||||
media_file_format * out_readable_formats, // don't write here if NULL
|
||||
int32 in_read_items, // this many slots in out_readable_formats
|
||||
int32 * out_read_items, // set this to actual # available, even if bigger than in count
|
||||
void * _reserved); // ignore until further notice
|
||||
virtual status_t SniffTypeKind( // Like SniffType, but for the specific kind(s)
|
||||
const BMimeType & type,
|
||||
uint64 in_kinds,
|
||||
float * out_quality,
|
||||
int32 * out_internal_id,
|
||||
void * _reserved);
|
||||
|
||||
image_id ImageID();
|
||||
media_addon_id AddonID();
|
||||
|
||||
protected:
|
||||
|
||||
// Calling this will cause everyone to get notified, and also
|
||||
// cause the server to re-scan your flavor info. It is thread safe.
|
||||
status_t NotifyFlavorChange();
|
||||
|
||||
private:
|
||||
BMediaAddOn(); /* private unimplemented */
|
||||
BMediaAddOn(const BMediaAddOn & clone);
|
||||
BMediaAddOn & operator=(const BMediaAddOn & clone);
|
||||
|
||||
friend class BPrivate::media::DormantNodeManager;
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_MediaAddOn_2(void *);
|
||||
virtual status_t _Reserved_MediaAddOn_3(void *);
|
||||
virtual status_t _Reserved_MediaAddOn_4(void *);
|
||||
virtual status_t _Reserved_MediaAddOn_5(void *);
|
||||
virtual status_t _Reserved_MediaAddOn_6(void *);
|
||||
virtual status_t _Reserved_MediaAddOn_7(void *);
|
||||
|
||||
image_id fImage;
|
||||
media_addon_id fAddon;
|
||||
uint32 _reserved_media_add_on_[7];
|
||||
};
|
||||
|
||||
|
||||
#if BUILDING_MEDIA_ADDON
|
||||
extern "C" _EXPORT BMediaAddOn * make_media_addon(image_id you);
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _MEDIA_ADD_ON_H */
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
#ifndef MEDIADECODER_H
|
||||
#define MEDIADECODER_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaFormats.h>
|
||||
|
||||
namespace BPrivate {
|
||||
class Decoder;
|
||||
}
|
||||
namespace BPrivate {
|
||||
namespace media {
|
||||
class Decoder;
|
||||
class DecoderPlugin;
|
||||
}
|
||||
}
|
||||
|
||||
class BMediaDecoder {
|
||||
public:
|
||||
BMediaDecoder();
|
||||
BMediaDecoder(const media_format *in_format,
|
||||
const void *info = NULL, size_t info_size = 0);
|
||||
BMediaDecoder(const media_codec_info *mci);
|
||||
virtual ~BMediaDecoder();
|
||||
status_t InitCheck() const;
|
||||
|
||||
status_t SetTo(const media_format *in_format,
|
||||
const void *info = NULL, size_t info_size = 0);
|
||||
status_t SetTo(const media_codec_info *mci);
|
||||
status_t SetInputFormat(const media_format *in_format,
|
||||
const void *in_info = NULL, size_t in_size = 0);
|
||||
status_t SetOutputFormat(media_format *output_format);
|
||||
// Set output format to closest acceptable format, returns the
|
||||
// format used.
|
||||
status_t Decode(void *out_buffer, int64 *out_frameCount,
|
||||
media_header *out_mh, media_decode_info *info);
|
||||
status_t GetDecoderInfo(media_codec_info *out_info) const;
|
||||
|
||||
protected:
|
||||
virtual status_t GetNextChunk(const void **chunkData, size_t *chunkLen,
|
||||
media_header *mh) = 0;
|
||||
|
||||
private:
|
||||
|
||||
// unimplemented
|
||||
BMediaDecoder(const BMediaDecoder &);
|
||||
BMediaDecoder & operator=(const BMediaDecoder &);
|
||||
|
||||
status_t AttachToDecoder();
|
||||
|
||||
BPrivate::media::Decoder *fDecoder;
|
||||
int32 fDecoderID;
|
||||
BPrivate::media::DecoderPlugin *fDecoderPlugin;
|
||||
int32 fDecoderPluginID;
|
||||
status_t fInitStatus;
|
||||
|
||||
bool fNeedsInit;
|
||||
media_format * fInitFormat;
|
||||
char * fInitInfo;
|
||||
size_t fInitInfoSize;
|
||||
|
||||
/* fbc data and virtuals */
|
||||
|
||||
uint32 _reserved_BMediaDecoder_[26];
|
||||
|
||||
virtual status_t _Reserved_BMediaDecoder_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaDecoder_15(int32 arg, ...);
|
||||
};
|
||||
|
||||
class BMediaBufferDecoder : public BMediaDecoder {
|
||||
public:
|
||||
BMediaBufferDecoder();
|
||||
BMediaBufferDecoder(const media_format *in_format,
|
||||
const void *info = NULL, size_t info_size = 0);
|
||||
BMediaBufferDecoder(const media_codec_info *mci);
|
||||
status_t DecodeBuffer(const void *input_buffer, size_t input_size,
|
||||
void *out_buffer, int64 *out_frameCount,
|
||||
media_header *out_mh,
|
||||
media_decode_info *info = NULL);
|
||||
protected:
|
||||
virtual status_t GetNextChunk(const void **chunkData, size_t *chunkLen,
|
||||
media_header *mh);
|
||||
const void *buffer;
|
||||
int32 buffer_size;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,736 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: MediaDefs.h
|
||||
/
|
||||
/ Description: Basic data types and defines for the Media Kit.
|
||||
/
|
||||
/ Copyright 1997-1999, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_MEDIA_DEFS_H)
|
||||
#define _MEDIA_DEFS_H
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <OS.h>
|
||||
#include <ByteOrder.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#include <GraphicsDefs.h>
|
||||
#include <Looper.h>
|
||||
#endif
|
||||
|
||||
|
||||
#define B_MEDIA_NAME_LENGTH 64
|
||||
|
||||
|
||||
enum { /* maybe migrate these into Errors.h */
|
||||
B_MEDIA_SYSTEM_FAILURE = (int)B_MEDIA_ERROR_BASE+0x100, /* 80004100 */
|
||||
B_MEDIA_BAD_NODE,
|
||||
B_MEDIA_NODE_BUSY,
|
||||
B_MEDIA_BAD_FORMAT,
|
||||
B_MEDIA_BAD_BUFFER,
|
||||
B_MEDIA_TOO_MANY_NODES,
|
||||
B_MEDIA_TOO_MANY_BUFFERS,
|
||||
B_MEDIA_NODE_ALREADY_EXISTS,
|
||||
B_MEDIA_BUFFER_ALREADY_EXISTS,
|
||||
B_MEDIA_CANNOT_SEEK,
|
||||
B_MEDIA_CANNOT_CHANGE_RUN_MODE,
|
||||
B_MEDIA_APP_ALREADY_REGISTERED,
|
||||
B_MEDIA_APP_NOT_REGISTERED,
|
||||
B_MEDIA_CANNOT_RECLAIM_BUFFERS,
|
||||
B_MEDIA_BUFFERS_NOT_RECLAIMED,
|
||||
B_MEDIA_TIME_SOURCE_STOPPED,
|
||||
B_MEDIA_TIME_SOURCE_BUSY, /* 80004110 */
|
||||
B_MEDIA_BAD_SOURCE,
|
||||
B_MEDIA_BAD_DESTINATION,
|
||||
B_MEDIA_ALREADY_CONNECTED,
|
||||
B_MEDIA_NOT_CONNECTED,
|
||||
B_MEDIA_BAD_CLIP_FORMAT,
|
||||
B_MEDIA_ADDON_FAILED,
|
||||
B_MEDIA_ADDON_DISABLED,
|
||||
B_MEDIA_CHANGE_IN_PROGRESS,
|
||||
B_MEDIA_STALE_CHANGE_COUNT,
|
||||
B_MEDIA_ADDON_RESTRICTED,
|
||||
B_MEDIA_NO_HANDLER,
|
||||
B_MEDIA_DUPLICATE_FORMAT,
|
||||
B_MEDIA_REALTIME_DISABLED,
|
||||
B_MEDIA_REALTIME_UNAVAILABLE
|
||||
};
|
||||
|
||||
/* Notification message 'what's */
|
||||
enum {
|
||||
// Note that BMediaNode::node_error also belongs in here! */
|
||||
B_MEDIA_WILDCARD = 'TRWC', /* used to match any notification in Start/StopWatching */
|
||||
B_MEDIA_NODE_CREATED = 'TRIA', /* "media_node_id" (multiple items) */
|
||||
B_MEDIA_NODE_DELETED, /* "media_node_id" (multiple items) */
|
||||
B_MEDIA_CONNECTION_MADE, /* "output", "input", "format" */
|
||||
B_MEDIA_CONNECTION_BROKEN, /* "source", "destination" */
|
||||
B_MEDIA_BUFFER_CREATED, /* "clone_info" -- handled by BMediaRoster */
|
||||
B_MEDIA_BUFFER_DELETED, /* "media_buffer_id" -- handled by BMediaRoster */
|
||||
B_MEDIA_TRANSPORT_STATE, /* "state", "location", "realtime" */
|
||||
B_MEDIA_PARAMETER_CHANGED, /* N "node", "parameter" */
|
||||
B_MEDIA_FORMAT_CHANGED, /* N "source", "destination", "format" */
|
||||
B_MEDIA_WEB_CHANGED, /* N "node" */
|
||||
B_MEDIA_DEFAULT_CHANGED, /* "default", "node" -- handled by BMediaRoster */
|
||||
B_MEDIA_NEW_PARAMETER_VALUE, /* N "node", "parameter", "when", "value" */
|
||||
B_MEDIA_NODE_STOPPED, /* N "node", "when" */
|
||||
B_MEDIA_FLAVORS_CHANGED /* "be:addon_id", "be:new_count", "be:gone_count" */
|
||||
};
|
||||
|
||||
enum media_type {
|
||||
B_MEDIA_NO_TYPE = -1,
|
||||
B_MEDIA_UNKNOWN_TYPE = 0,
|
||||
B_MEDIA_RAW_AUDIO = 1, /* uncompressed raw_audio -- linear relationship bytes <-> samples */
|
||||
B_MEDIA_RAW_VIDEO, /* uncompressed raw_video -- linear relationship bytes <-> pixels */
|
||||
B_MEDIA_VBL, /* raw data from VBL area, 1600/line */
|
||||
B_MEDIA_TIMECODE, /* data format TBD */
|
||||
B_MEDIA_MIDI,
|
||||
B_MEDIA_TEXT, /* typically closed captioning */
|
||||
B_MEDIA_HTML,
|
||||
B_MEDIA_MULTISTREAM, /* AVI, etc */
|
||||
B_MEDIA_PARAMETERS, /* BControllable change data */
|
||||
B_MEDIA_ENCODED_AUDIO, /* dts, AC3, ... */
|
||||
B_MEDIA_ENCODED_VIDEO, /* Indeo, MPEG, ... */
|
||||
B_MEDIA_PRIVATE = 90000, /* Don't touch! */
|
||||
B_MEDIA_FIRST_USER_TYPE = 100000 /* Use something bigger than this for */
|
||||
/* experimentation with your own media forms */
|
||||
};
|
||||
|
||||
enum node_kind {
|
||||
B_BUFFER_PRODUCER = 0x1,
|
||||
B_BUFFER_CONSUMER = 0x2,
|
||||
B_TIME_SOURCE = 0x4,
|
||||
B_CONTROLLABLE = 0x8,
|
||||
B_FILE_INTERFACE = 0x10,
|
||||
B_ENTITY_INTERFACE = 0x20,
|
||||
/* Set these flags for nodes that are suitable as default entities */
|
||||
B_PHYSICAL_INPUT = 0x10000,
|
||||
B_PHYSICAL_OUTPUT = 0x20000,
|
||||
B_SYSTEM_MIXER = 0x40000
|
||||
};
|
||||
|
||||
enum video_orientation { /* for orientation, which pixel is first and how do we scan each "line"? */
|
||||
B_VIDEO_TOP_LEFT_RIGHT = 1, /* This is the typical progressive scan format */
|
||||
B_VIDEO_BOTTOM_LEFT_RIGHT /* This is how BMP and TGA might scan */
|
||||
};
|
||||
|
||||
|
||||
enum media_flags /* data */
|
||||
{
|
||||
B_MEDIA_FLAGS_VERSION = 1, /* uint32, bigger for newer */
|
||||
B_MEDIA_FLAGS_PRIVATE = 0x40000000 /* private to Be */
|
||||
};
|
||||
|
||||
|
||||
enum media_producer_status { /* for producer status */
|
||||
B_DATA_NOT_AVAILABLE = 1,
|
||||
B_DATA_AVAILABLE = 2,
|
||||
B_PRODUCER_STOPPED = 3
|
||||
};
|
||||
|
||||
// realtime flags
|
||||
enum media_realtime_flags {
|
||||
B_MEDIA_REALTIME_ALLOCATOR = 0x1,
|
||||
B_MEDIA_REALTIME_AUDIO = 0x2,
|
||||
B_MEDIA_REALTIME_VIDEO = 0x4,
|
||||
B_MEDIA_REALTIME_ANYKIND = 0xffff
|
||||
};
|
||||
|
||||
enum media_frame_flags {
|
||||
B_MEDIA_KEY_FRAME = 0x1
|
||||
};
|
||||
|
||||
#define B_MEDIA_ANY_QUALITY 0.0f
|
||||
#define B_MEDIA_LOW_QUALITY 0.1f
|
||||
#define B_MEDIA_MEDIUM_QUALITY 0.5f
|
||||
#define B_MEDIA_HIGH_QUALITY 1.0f
|
||||
|
||||
|
||||
#if !defined(_MULTI_AUDIO_H) /* #define in protocol header */
|
||||
enum media_multi_channels {
|
||||
B_CHANNEL_LEFT = 0x1,
|
||||
B_CHANNEL_RIGHT = 0x2,
|
||||
B_CHANNEL_CENTER = 0x4, /* 5.1+ or fake surround */
|
||||
B_CHANNEL_SUB = 0x8, /* 5.1+ */
|
||||
B_CHANNEL_REARLEFT = 0x10, /* quad surround or 5.1+ */
|
||||
B_CHANNEL_REARRIGHT = 0x20, /* quad surround or 5.1+ */
|
||||
B_CHANNEL_FRONT_LEFT_CENTER = 0x40,
|
||||
B_CHANNEL_FRONT_RIGHT_CENTER = 0x80,
|
||||
B_CHANNEL_BACK_CENTER = 0x100, /* 6.1 or fake surround */
|
||||
B_CHANNEL_SIDE_LEFT = 0x200,
|
||||
B_CHANNEL_SIDE_RIGHT = 0x400,
|
||||
B_CHANNEL_TOP_CENTER = 0x800,
|
||||
B_CHANNEL_TOP_FRONT_LEFT = 0x1000,
|
||||
B_CHANNEL_TOP_FRONT_CENTER = 0x2000,
|
||||
B_CHANNEL_TOP_FRONT_RIGHT = 0x4000,
|
||||
B_CHANNEL_TOP_BACK_LEFT = 0x8000,
|
||||
B_CHANNEL_TOP_BACK_CENTER = 0x10000,
|
||||
B_CHANNEL_TOP_BACK_RIGHT = 0x20000
|
||||
};
|
||||
enum media_multi_matrix {
|
||||
B_MATRIX_PROLOGIC_LR = 0x1,
|
||||
B_MATRIX_AMBISONIC_WXYZ = 0x4
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
typedef int32 media_node_id;
|
||||
typedef int32 media_buffer_id;
|
||||
typedef int32 media_addon_id;
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
struct media_destination {
|
||||
media_destination(port_id, int32);
|
||||
media_destination(const media_destination & clone);
|
||||
media_destination & operator=(const media_destination & clone);
|
||||
media_destination();
|
||||
~media_destination();
|
||||
port_id port; /* can be different from media_node.port */
|
||||
int32 id;
|
||||
static media_destination null;
|
||||
private:
|
||||
uint32 _reserved_media_destination_[2];
|
||||
};
|
||||
|
||||
struct media_source {
|
||||
media_source(port_id, int32);
|
||||
media_source(const media_source & clone);
|
||||
media_source & operator=(const media_source & clone);
|
||||
media_source();
|
||||
~media_source();
|
||||
port_id port; /* must be the same as media_node.port for owner */
|
||||
int32 id;
|
||||
static media_source null;
|
||||
private:
|
||||
uint32 _reserved_media_source_[2];
|
||||
};
|
||||
|
||||
_IMPEXP_MEDIA bool operator==(const media_destination & a, const media_destination & b);
|
||||
_IMPEXP_MEDIA bool operator!=(const media_destination & a, const media_destination & b);
|
||||
_IMPEXP_MEDIA bool operator<(const media_destination & a, const media_destination & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_source & a, const media_source & b);
|
||||
_IMPEXP_MEDIA bool operator!=(const media_source & a, const media_source & b);
|
||||
_IMPEXP_MEDIA bool operator<(const media_source & a, const media_source & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_node & a, const media_node & b);
|
||||
_IMPEXP_MEDIA bool operator!=(const media_node & a, const media_node & b);
|
||||
_IMPEXP_MEDIA bool operator<(const media_node & a, const media_node & b);
|
||||
|
||||
|
||||
|
||||
/* Buffers are low-level constructs identified by an ID. */
|
||||
/* Buffers consist of the actual data area, plus a 64-byte */
|
||||
/* header area that is different for each type. */
|
||||
/* Buffers contain typed data. Type is not part of the */
|
||||
/* buffer header; it's negotiated out-of-bounds by nodes. */
|
||||
|
||||
enum {
|
||||
B_MEDIA_BIG_ENDIAN = 1,
|
||||
B_MEDIA_LITTLE_ENDIAN = 2,
|
||||
#if B_HOST_IS_BENDIAN
|
||||
B_MEDIA_HOST_ENDIAN = B_MEDIA_BIG_ENDIAN
|
||||
#else
|
||||
B_MEDIA_HOST_ENDIAN = B_MEDIA_LITTLE_ENDIAN
|
||||
#endif
|
||||
};
|
||||
|
||||
struct media_multi_audio_format;
|
||||
|
||||
struct media_raw_audio_format {
|
||||
enum { // for "format"
|
||||
B_AUDIO_FLOAT = 0x24, // 0 == mid, -1.0 == bottom, 1.0 == top (the preferred format for non-game audio)
|
||||
B_AUDIO_INT = 0x4, // 0 == mid, 0x80000001 == bottom, 0x7fffffff == top (all >16-bit formats, left-adjusted)
|
||||
B_AUDIO_SHORT = 0x2, // 0 == mid, -32767 == bottom, +32767 == top
|
||||
B_AUDIO_UCHAR = 0x11, // 128 == mid, 1 == bottom, 255 == top (discouraged but supported format)
|
||||
B_AUDIO_CHAR = 0x1, // 0 == mid, -127 == bottom, +127 == top (not officially supported format)
|
||||
B_AUDIO_SIZE_MASK = 0xf
|
||||
}; // we guarantee that (format&0xf) == sizeof(sample) for raw formats
|
||||
|
||||
float frame_rate;
|
||||
uint32 channel_count; // 1 or 2, mostly
|
||||
uint32 format; // for compressed formats, go to media_encoded_audio_format
|
||||
uint32 byte_order; // 2 for little endian (B_MEDIA_LITTLE_ENDIAN), 1 for big endian (B_MEDIA_BIG_ENDIAN)
|
||||
size_t buffer_size; // size of each buffer
|
||||
|
||||
static media_multi_audio_format wildcard;
|
||||
};
|
||||
|
||||
struct media_audio_header {
|
||||
// please put actual data at the end
|
||||
int32 _reserved_[16]; // gotta have something
|
||||
};
|
||||
|
||||
struct media_multi_audio_info {
|
||||
uint32 channel_mask; // bitmask
|
||||
int16 valid_bits; // if < 32, for B_AUDIO_INT
|
||||
uint16 matrix_mask; // each of these bits may mean more than one channel
|
||||
|
||||
uint32 _reserved_b[3];
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
struct media_multi_audio_format : public media_raw_audio_format, public media_multi_audio_info {
|
||||
static media_multi_audio_format wildcard;
|
||||
};
|
||||
#else
|
||||
struct media_multi_audio_format {
|
||||
media_raw_audio_format raw;
|
||||
media_multi_audio_info multi;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
struct media_encoded_audio_format {
|
||||
enum audio_encoding {
|
||||
B_ANY
|
||||
};
|
||||
media_raw_audio_format output;
|
||||
audio_encoding encoding;
|
||||
|
||||
float bit_rate; // BIT rate, not byte rate
|
||||
size_t frame_size;
|
||||
|
||||
media_multi_audio_info multi_info;
|
||||
|
||||
uint32 _reserved_[3];
|
||||
|
||||
static media_encoded_audio_format wildcard;
|
||||
};
|
||||
|
||||
struct media_encoded_audio_header {
|
||||
// please put actual data at the end
|
||||
int32 _reserved_0[14]; // gotta have something
|
||||
uint32 buffer_flags; // B_MEDIA_KEY_FRAME for key buffers (ADPCM etc)
|
||||
uchar unused_mask; // mask of unused bits for the last byte of data
|
||||
uchar _reserved_2[3];
|
||||
|
||||
};
|
||||
|
||||
enum media_display_flags {
|
||||
B_F1_DOMINANT = 0x1, // The first buffer sent (temporally) will be an F1 field
|
||||
B_F2_DOMINANT = 0x2, // The first buffer sent (temporally) will be an F2 field
|
||||
B_TOP_SCANLINE_F1 = 0x4, // The topmost scanline of the output buffer belongs to F1
|
||||
B_TOP_SCANLINE_F2 = 0x8 // The topmost scanline of the output buffer belongs to F2
|
||||
};
|
||||
struct media_video_display_info {
|
||||
color_space format;
|
||||
uint32 line_width;
|
||||
uint32 line_count; // total of all interlace fields
|
||||
uint32 bytes_per_row; // bytes_per_row is in format, not header, because it's part of SetBuffers
|
||||
uint32 pixel_offset; // (in pixels) ... These are offsets from the start of the buffer ...
|
||||
uint32 line_offset; // (in lines) ... to the start of the field. Think "buffer == framebuffer" ...
|
||||
// ... when the window displaying the active field moves on screen.
|
||||
uint32 flags;
|
||||
uint32 _reserved_[3];
|
||||
static media_video_display_info wildcard;
|
||||
};
|
||||
|
||||
struct media_raw_video_format {
|
||||
float field_rate;
|
||||
uint32 interlace; // how many fields per frame -- 1 means progressive (non-interlaced)
|
||||
uint32 first_active; // 0, typically (wildcard, or "don't care")
|
||||
uint32 last_active; // line_count-1, if first_active is 0.
|
||||
uint32 orientation; // B_VIDEO_TOP_LEFT_RIGHT is preferred
|
||||
// PIXEL aspect ratio; not active area aspect ratio...
|
||||
uint16 pixel_width_aspect; // 1:1 has 1 here, 4:3 has 4 here
|
||||
uint16 pixel_height_aspect; // 1:1 has 1 here, 4:3 has 3 here
|
||||
|
||||
media_video_display_info display;
|
||||
|
||||
static media_raw_video_format wildcard;
|
||||
};
|
||||
|
||||
struct media_video_header {
|
||||
uint32 _reserved_[12]; // at the top to push used data to the end
|
||||
float field_gamma;
|
||||
uint32 field_sequence; // sequence since start of capture -- may roll over if machine is on for a LONG time
|
||||
uint16 field_number; // 0 .. {interlace-1}; F1 == 0 ("odd"), F2 == 1 ("even")
|
||||
uint16 pulldown_number; // 0..2 for pulldown duplicated sequence
|
||||
uint16 first_active_line; // the NTSC/PAL line number (1-based) of the first line in this field
|
||||
uint16 line_count; // number of active lines in buffer
|
||||
};
|
||||
|
||||
struct media_encoded_video_format {
|
||||
enum video_encoding {
|
||||
B_ANY
|
||||
};
|
||||
media_raw_video_format output; // set unknowns to wildcard
|
||||
float avg_bit_rate;
|
||||
float max_bit_rate;
|
||||
video_encoding encoding;
|
||||
size_t frame_size;
|
||||
int16 forward_history; // maximum forward memory required by algorithm
|
||||
int16 backward_history; // maximum backward memory required by algorithm
|
||||
|
||||
uint32 _reserved_[3]; // can't grow more than this
|
||||
|
||||
static media_encoded_video_format wildcard;
|
||||
};
|
||||
|
||||
struct media_encoded_video_header {
|
||||
/* please put actual data at the end */
|
||||
int32 _reserved_1[9]; // gotta have something...
|
||||
|
||||
uint32 field_flags; // B_MEDIA_KEY_FRAME
|
||||
|
||||
int16 forward_history; // forward memory required by this buffer (0 for key frames)
|
||||
int16 backward_history; // backward memory required by this buffer (0 for key frames)
|
||||
uchar unused_mask; // mask of unused bits for the last byte of data
|
||||
uchar _reserved_2[3];
|
||||
float field_gamma;
|
||||
uint32 field_sequence; // sequence since start of capture
|
||||
uint16 field_number; // 0 .. {interlace-1}; F1 == 0, F2 == 1
|
||||
uint16 pulldown_number; // 0..2 for pulldown duplicated sequence
|
||||
uint16 first_active_line; // 0 or 1, typically, but could be 10 or 11 for full-NTSC formats
|
||||
uint16 line_count; // number of actual lines in buffer
|
||||
};
|
||||
|
||||
struct media_multistream_format {
|
||||
enum {
|
||||
B_ANY = 0,
|
||||
B_VID = 1, // raw raw_video/raw_audio buffers
|
||||
B_AVI,
|
||||
B_MPEG1,
|
||||
B_MPEG2,
|
||||
B_QUICKTIME,
|
||||
B_PRIVATE = 90000,
|
||||
B_FIRST_USER_TYPE = 100000 // user formats >= 100000
|
||||
};
|
||||
float avg_bit_rate; // 8 * byte rate, on average
|
||||
float max_bit_rate; // 8 * byte rate, tops
|
||||
uint32 avg_chunk_size; // == max_chunk_size for fixed-size chunks
|
||||
uint32 max_chunk_size; // max buffer size
|
||||
enum {
|
||||
B_HEADER_HAS_FLAGS = 0x1, // are flags important?
|
||||
B_CLEAN_BUFFERS = 0x2, // each buffer represents an integral number of "frames"
|
||||
B_HOMOGENOUS_BUFFERS = 0x4 // a buffer has only one format in it
|
||||
};
|
||||
uint32 flags;
|
||||
int32 format;
|
||||
uint32 _reserved_[2];
|
||||
|
||||
struct vid_info {
|
||||
float frame_rate;
|
||||
uint16 width;
|
||||
uint16 height;
|
||||
color_space space;
|
||||
|
||||
float sampling_rate;
|
||||
uint32 sample_format;
|
||||
uint16 byte_order;
|
||||
uint16 channel_count;
|
||||
};
|
||||
struct avi_info {
|
||||
uint32 us_per_frame;
|
||||
uint16 width;
|
||||
uint16 height;
|
||||
uint16 _reserved_;
|
||||
uint16 type_count;
|
||||
media_type types[5];
|
||||
};
|
||||
|
||||
union {
|
||||
vid_info vid;
|
||||
avi_info avi;
|
||||
} u;
|
||||
|
||||
static media_multistream_format wildcard;
|
||||
};
|
||||
|
||||
struct media_multistream_header {
|
||||
uint32 _reserved_[14];
|
||||
uchar unused_mask; // mask of unused bits for the last byte of data
|
||||
uchar _reserved_2[3];
|
||||
enum {
|
||||
B_MASTER_HEADER = 0x1, // for master stream header data in buffer
|
||||
B_SUBSTREAM_HEADER = 0x2, // for sub-stream header data in buffer
|
||||
B_COMPLETE_BUFFER = 0x4 // data is an integral number of "frames"
|
||||
};
|
||||
uint32 flags;
|
||||
};
|
||||
|
||||
extern const type_code B_CODEC_TYPE_INFO;
|
||||
|
||||
enum media_format_flags {
|
||||
B_MEDIA_RETAINED_DATA = 0x1,
|
||||
B_MEDIA_MULTIPLE_BUFFERS = 0x2,
|
||||
B_MEDIA_CONTIGUOUS_BUFFER = 0x4,
|
||||
B_MEDIA_LINEAR_UPDATES = 0x8,
|
||||
B_MEDIA_MAUI_UNDEFINED_FLAGS = ~0xf /* always deny these */
|
||||
};
|
||||
|
||||
/* typically, a field of 0 means "anything" or "wildcard" */
|
||||
struct media_format { /* no more than 192 bytes */
|
||||
media_type type;
|
||||
type_code user_data_type;
|
||||
uchar user_data[48];
|
||||
uint32 _reserved_[3];
|
||||
uint16 require_flags; // media_format_flags
|
||||
uint16 deny_flags; // media_format_flags
|
||||
|
||||
private:
|
||||
|
||||
void * meta_data;
|
||||
int32 meta_data_size;
|
||||
area_id meta_data_area;
|
||||
area_id use_area;
|
||||
team_id team;
|
||||
void * thisPtr;
|
||||
|
||||
public:
|
||||
|
||||
union {
|
||||
media_multi_audio_format raw_audio;
|
||||
media_raw_video_format raw_video;
|
||||
media_multistream_format multistream;
|
||||
media_encoded_audio_format encoded_audio;
|
||||
media_encoded_video_format encoded_video;
|
||||
char _reserved_[96]; // pad to 96 bytes
|
||||
} u;
|
||||
|
||||
bool IsVideo() const { return (type==B_MEDIA_ENCODED_VIDEO)||(type==B_MEDIA_RAW_VIDEO); };
|
||||
uint32 Width() const { return (type==B_MEDIA_ENCODED_VIDEO)?u.encoded_video.output.display.line_width:u.raw_video.display.line_width; };
|
||||
uint32 Height() const { return (type==B_MEDIA_ENCODED_VIDEO)?u.encoded_video.output.display.line_count:u.raw_video.display.line_count; };
|
||||
color_space ColorSpace() const { return (type==B_MEDIA_ENCODED_VIDEO)?u.encoded_video.output.display.format:u.raw_video.display.format; };
|
||||
uint32 & Width() { return (type==B_MEDIA_ENCODED_VIDEO)?u.encoded_video.output.display.line_width:u.raw_video.display.line_width; };
|
||||
uint32 & Height() { return (type==B_MEDIA_ENCODED_VIDEO)?u.encoded_video.output.display.line_count:u.raw_video.display.line_count; };
|
||||
color_space & ColorSpace() { return (type==B_MEDIA_ENCODED_VIDEO)?u.encoded_video.output.display.format:u.raw_video.display.format; };
|
||||
|
||||
bool IsAudio() const { return (type==B_MEDIA_ENCODED_AUDIO)||(type==B_MEDIA_RAW_AUDIO); };
|
||||
uint32 AudioFormat() const { return (type==B_MEDIA_ENCODED_AUDIO)?u.encoded_audio.output.format:u.raw_audio.format; };
|
||||
uint32 & AudioFormat() { return (type==B_MEDIA_ENCODED_AUDIO)?u.encoded_audio.output.format:u.raw_audio.format; };
|
||||
uint32 AudioFrameSize() const { return (type==B_MEDIA_ENCODED_AUDIO)?(u.encoded_audio.output.format & 0xf)*u.encoded_audio.output.channel_count:(u.raw_audio.format & 0xf)*u.raw_audio.channel_count; };
|
||||
|
||||
uint32 Encoding() const { return (type==B_MEDIA_ENCODED_VIDEO)?u.encoded_video.encoding:(type==B_MEDIA_ENCODED_AUDIO)?u.encoded_audio.encoding:(type==B_MEDIA_MULTISTREAM)?u.multistream.format:0UL; }
|
||||
|
||||
bool Matches(const media_format *otherFormat) const;
|
||||
void SpecializeTo(const media_format *otherFormat);
|
||||
|
||||
status_t SetMetaData(const void *data, size_t size);
|
||||
const void * MetaData() const;
|
||||
int32 MetaDataSize() const;
|
||||
|
||||
media_format();
|
||||
media_format(const media_format &other);
|
||||
~media_format();
|
||||
media_format & operator=(const media_format & clone);
|
||||
};
|
||||
|
||||
_IMPEXP_MEDIA bool operator==(const media_raw_audio_format & a, const media_raw_audio_format & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_multi_audio_info & a, const media_multi_audio_info & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_multi_audio_format & a, const media_multi_audio_format & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_encoded_audio_format & a, const media_encoded_audio_format & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_video_display_info & a, const media_video_display_info & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_raw_video_format & a, const media_raw_video_format & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_encoded_video_format & a, const media_encoded_video_format & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_multistream_format::vid_info & a, const media_multistream_format::vid_info & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_multistream_format::avi_info & a, const media_multistream_format::avi_info & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_multistream_format & a, const media_multistream_format & b);
|
||||
_IMPEXP_MEDIA bool operator==(const media_format & a, const media_format & b);
|
||||
|
||||
/* return true if a and b are compatible (accounting for wildcards) */
|
||||
_IMPEXP_MEDIA bool format_is_compatible(const media_format & a, const media_format & b); /* a is the format you want to feed to something accepting b */
|
||||
_IMPEXP_MEDIA bool string_for_format(const media_format & f, char * buf, size_t size);
|
||||
|
||||
struct media_seek_tag {
|
||||
char data[16];
|
||||
};
|
||||
|
||||
struct media_header_time_code {
|
||||
int8 type; // See TimeCode.h; don't use the "DEFAULT" value
|
||||
int8 _reserved;
|
||||
int8 hours;
|
||||
int8 minutes;
|
||||
int8 seconds;
|
||||
int8 frames;
|
||||
int16 subframes; // -1 if not available
|
||||
};
|
||||
|
||||
struct media_header { // Broadcast() fills in fields marked with "//+"
|
||||
media_type type; // what kind of data (for union)
|
||||
media_buffer_id buffer; //+ what buffer does this header go with?
|
||||
int32 destination; //+ what 'socket' is this intended for?
|
||||
media_node_id time_source; // node that encoded start_time
|
||||
uint32 _deprecated_; // used to be change_tag
|
||||
uint32 size_used; // size within buffer that is used
|
||||
bigtime_t start_time; // performance time
|
||||
area_id owner; //+ buffer owner info area
|
||||
enum {
|
||||
B_SEEK_TAG = 'TRST', // user data type of the codec seek
|
||||
// protocol. size of seek tag is 16 bytes
|
||||
B_TIME_CODE = 'TRTC' // user data is media_header_time_code
|
||||
};
|
||||
type_code user_data_type;
|
||||
uchar user_data[64]; // user_data_type indicates what this is
|
||||
uint32 _reserved_[2];
|
||||
|
||||
off_t file_pos; // where in a file this data came from
|
||||
size_t orig_size; // and how big it was. if unused, zero out
|
||||
|
||||
uint32 data_offset; // offset within buffer (already reflected in Data())
|
||||
|
||||
union {
|
||||
media_audio_header raw_audio;
|
||||
media_video_header raw_video;
|
||||
media_multistream_header multistream;
|
||||
media_encoded_audio_header encoded_audio;
|
||||
media_encoded_video_header encoded_video;
|
||||
char _reserved_[64]; // pad to 64 bytes
|
||||
} u;
|
||||
};
|
||||
|
||||
|
||||
struct media_file_format_id {
|
||||
ino_t node;
|
||||
dev_t device;
|
||||
uint32 internal_id;
|
||||
};
|
||||
_IMPEXP_MEDIA bool operator==(const media_file_format_id & a, const media_file_format_id & b);
|
||||
_IMPEXP_MEDIA bool operator<(const media_file_format_id & a, const media_file_format_id & b);
|
||||
|
||||
typedef enum {
|
||||
B_ANY_FORMAT_FAMILY = 0,
|
||||
B_BEOS_FORMAT_FAMILY = 1,
|
||||
B_QUICKTIME_FORMAT_FAMILY = 2, /* QuickTime is a registered trademark of Apple Computer */
|
||||
B_AVI_FORMAT_FAMILY = 3,
|
||||
B_ASF_FORMAT_FAMILY = 4,
|
||||
B_MPEG_FORMAT_FAMILY = 5,
|
||||
B_WAV_FORMAT_FAMILY = 6,
|
||||
B_AIFF_FORMAT_FAMILY = 7,
|
||||
B_AVR_FORMAT_FAMILY = 8,
|
||||
B_MISC_FORMAT_FAMILY = 99999,
|
||||
} media_format_family;
|
||||
|
||||
struct media_file_format {
|
||||
enum { /* flags */
|
||||
B_READABLE = 0x1,
|
||||
B_WRITABLE = 0x2,
|
||||
B_PERFECTLY_SEEKABLE = 0x4,
|
||||
B_IMPERFECTLY_SEEKABLE = 0x8,
|
||||
B_KNOWS_RAW_VIDEO = 0x10,
|
||||
B_KNOWS_RAW_AUDIO = 0x20,
|
||||
B_KNOWS_MIDI = 0x40,
|
||||
B_KNOWS_ENCODED_VIDEO = 0x80,
|
||||
B_KNOWS_ENCODED_AUDIO = 0x100,
|
||||
B_KNOWS_OTHER = 0x1000000, /* clipping, text, control, ... */
|
||||
B_KNOWS_ANYTHING = 0x2000000
|
||||
};
|
||||
uint32 capabilities; // can this format support audio, video, etc
|
||||
media_file_format_id id; // opaque id used to construct a BMediaFile
|
||||
media_format_family family; // one of the family enums
|
||||
int32 version; // 100 for 1.0
|
||||
|
||||
uint32 _reserved_[25];
|
||||
|
||||
char mime_type[64]; // eg: "video/quicktime", "audio/aiff", etc
|
||||
char pretty_name[64]; // eg: "QuickTime File Format"
|
||||
char short_name[32]; // eg: "quicktime", "avi", "mpeg"
|
||||
char file_extension[8]; // eg: "mov", "avi", "mpg"
|
||||
char reserved[88];
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Use this function iterate through available file format writers
|
||||
//
|
||||
status_t get_next_file_format(int32 *cookie, media_file_format *mfi);
|
||||
|
||||
|
||||
|
||||
/* This struct is guaranteed to be large enough for any message your service */
|
||||
/* thread will get for any media_node -- 16k is an upper-bound size limit. */
|
||||
/* In your thread, read_port() into this struct, and call HandleMessage() on it. */
|
||||
const size_t B_MEDIA_MESSAGE_SIZE = 16384;
|
||||
|
||||
_IMPEXP_MEDIA extern const char * B_MEDIA_SERVER_SIGNATURE;
|
||||
|
||||
class media_node; /* found in MediaNode.h */
|
||||
struct media_input;
|
||||
struct media_output;
|
||||
struct live_node_info;
|
||||
struct dormant_node_info;
|
||||
struct buffer_clone_info;
|
||||
|
||||
|
||||
// If you for some reason need to get rid of the media_server (and friends)
|
||||
// use these functions, rather than sending messages yourself.
|
||||
// The callback will be called for various stages of the process, with 100 meaning completely done
|
||||
// The callback should always return TRUE for the time being.
|
||||
status_t shutdown_media_server(bigtime_t timeout = B_INFINITE_TIMEOUT, bool (*progress)(int stage, const char * message, void * cookie) = NULL, void * cookie = NULL);
|
||||
status_t launch_media_server(uint32 flags = 0);
|
||||
|
||||
// Given an image_id, prepare that image_id for realtime media
|
||||
// If the kind of media indicated by "flags" is not enabled for real-time,
|
||||
// B_MEDIA_REALTIME_DISABLED is returned.
|
||||
// If there are not enough system resources to enable real-time performance,
|
||||
// B_MEDIA_REALTIME_UNAVAILABLE is returned.
|
||||
status_t media_realtime_init_image(image_id image, uint32 flags);
|
||||
|
||||
// Given a thread ID, and an optional indication of what the thread is
|
||||
// doing in "flags", prepare the thread for real-time media performance.
|
||||
// Currently, this means locking the thread stack, up to size_used bytes,
|
||||
// or all of it if 0 is passed. Typically, you will not be using all
|
||||
// 256 kB of the stack, so you should pass some smaller value you determine
|
||||
// from profiling the thread; typically in the 32-64kB range.
|
||||
// Return values are the same as for media_prepare_realtime_image().
|
||||
status_t media_realtime_init_thread(thread_id thread, size_t stack_used, uint32 flags);
|
||||
|
||||
// A teeny bit of legacy preserved for BSoundFile from R3.
|
||||
// These came from the old MediaDefs.h; don't use them
|
||||
// unless you get them from BSoundFile.
|
||||
|
||||
/* values for byte_ordering */
|
||||
enum { B_BIG_ENDIAN, B_LITTLE_ENDIAN };
|
||||
|
||||
/* values for sample_format */
|
||||
enum {
|
||||
B_UNDEFINED_SAMPLES,
|
||||
B_LINEAR_SAMPLES,
|
||||
B_FLOAT_SAMPLES,
|
||||
B_MULAW_SAMPLES
|
||||
};
|
||||
|
||||
|
||||
/* for encoders and file writers */
|
||||
|
||||
struct media_encode_info {
|
||||
uint32 flags; /* B_MEDIA_KEY_FRAME, set before every use */
|
||||
int32 used_data_size; /* data size used by other tracks */
|
||||
/* add output size used by this encoder */
|
||||
bigtime_t start_time; /* us from start of file */
|
||||
bigtime_t time_to_encode; /* 0 - hurry up, B_INFINITE_TIMEOUT - don't care */
|
||||
int32 _pad[22];
|
||||
void *file_format_data; /* file format specific info */
|
||||
size_t file_format_data_size;
|
||||
void *codec_data; /* codec specific info */
|
||||
size_t codec_data_size;
|
||||
|
||||
media_encode_info();
|
||||
};
|
||||
|
||||
struct encode_parameters {
|
||||
float quality; // 0.0-1.0 , 1.0 is high quality
|
||||
int32 avg_field_size; // in bytes
|
||||
int32 max_field_size; // in bytes
|
||||
int32 _pad[27];
|
||||
void *user_data; // codec specific info
|
||||
size_t user_data_size;
|
||||
};
|
||||
|
||||
struct media_decode_info {
|
||||
bigtime_t time_to_decode; /* 0 - hurry up, B_INFINITE_TIMEOUT - don't care */
|
||||
int32 _pad[26];
|
||||
void *file_format_data; /* file format specific info */
|
||||
size_t file_format_data_size;
|
||||
void *codec_data; /* codec specific info */
|
||||
size_t codec_data_size;
|
||||
|
||||
media_decode_info();
|
||||
};
|
||||
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif /* MEDIA_DEFS_H */
|
||||
@@ -1,91 +0,0 @@
|
||||
#ifndef MEDIAENCODER_H
|
||||
#define MEDIAENCODER_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaFormats.h>
|
||||
|
||||
namespace BPrivate {
|
||||
class Encoder;
|
||||
class _AddonManager;
|
||||
}
|
||||
|
||||
class BMediaEncoder {
|
||||
public:
|
||||
BMediaEncoder();
|
||||
BMediaEncoder(const media_format *output_format);
|
||||
BMediaEncoder(const media_codec_info *mci);
|
||||
virtual ~BMediaEncoder();
|
||||
status_t InitCheck() const;
|
||||
|
||||
status_t SetTo(const media_format *output_format);
|
||||
status_t SetTo(const media_codec_info *mci);
|
||||
status_t SetFormat(media_format *input_format,
|
||||
media_format *output_format,
|
||||
media_file_format *mfi = NULL);
|
||||
status_t Encode(const void *buffer, int64 frame_count,
|
||||
media_encode_info *info);
|
||||
status_t GetEncodeParameters(encode_parameters *parameters) const;
|
||||
status_t SetEncodeParameters(encode_parameters *parameters);
|
||||
protected:
|
||||
virtual status_t WriteChunk(const void *chunk_data, size_t chunk_len,
|
||||
media_encode_info *info) = 0;
|
||||
virtual status_t AddTrackInfo(uint32 code, const char *data, size_t size);
|
||||
|
||||
private:
|
||||
// unimplemented
|
||||
BMediaEncoder(const BMediaEncoder &);
|
||||
BMediaEncoder & operator=(const BMediaEncoder &);
|
||||
|
||||
static status_t write_chunk(void *classptr, const void *chunk_data,
|
||||
size_t chunk_len, media_encode_info *info);
|
||||
void Init();
|
||||
void ReleaseEncoder();
|
||||
|
||||
BPrivate::_AddonManager *fEncoderMgr;
|
||||
BPrivate::Encoder *fEncoder;
|
||||
int32 fEncoderID;
|
||||
bool fFormatValid;
|
||||
bool fEncoderStarted;
|
||||
status_t fInitStatus;
|
||||
|
||||
/* fbc data and virtuals */
|
||||
|
||||
uint32 _reserved_BMediaEncoder_[32];
|
||||
|
||||
virtual status_t _Reserved_BMediaEncoder_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEncoder_15(int32 arg, ...);
|
||||
};
|
||||
|
||||
class BMediaBufferEncoder: public BMediaEncoder {
|
||||
public:
|
||||
BMediaBufferEncoder();
|
||||
BMediaBufferEncoder(const media_format *output_format);
|
||||
BMediaBufferEncoder(const media_codec_info *mci);
|
||||
status_t EncodeToBuffer(void *output_buffer, size_t *output_size,
|
||||
const void *input_buffer, int64 frame_count,
|
||||
media_encode_info *info);
|
||||
protected:
|
||||
virtual status_t WriteChunk(const void *chunk_data, size_t chunk_len,
|
||||
media_encode_info *info);
|
||||
|
||||
void *fBuffer;
|
||||
int32 fBufferSize;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: MediaEventLooper.h
|
||||
/
|
||||
/ Description: BMediaEventLooper spawns a thread which calls WaitForMessage,
|
||||
/ pushes BMediaNode messages onto its BTimedEventQueues.
|
||||
/ informs you when it is time to handle an event.
|
||||
/ Report your event latency, push other events onto the queue
|
||||
/ and override HandleEvent to do your work.
|
||||
/
|
||||
/ Copyright 1999, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_MEDIA_EVENT_LOOPER_H)
|
||||
#define _MEDIA_EVENT_LOOPER_H
|
||||
|
||||
#include <MediaNode.h>
|
||||
#include <TimedEventQueue.h>
|
||||
|
||||
class BMediaEventLooper :
|
||||
public virtual BMediaNode
|
||||
{
|
||||
protected:
|
||||
enum run_state {
|
||||
B_IN_DISTRESS = -1,
|
||||
B_UNREGISTERED,
|
||||
B_STOPPED,
|
||||
B_STARTED,
|
||||
B_QUITTING,
|
||||
B_TERMINATED,
|
||||
B_USER_RUN_STATES = 0x4000
|
||||
};
|
||||
|
||||
protected:
|
||||
/* this has to be on top rather than bottom to force a vtable in mwcc */
|
||||
virtual ~BMediaEventLooper();
|
||||
explicit BMediaEventLooper(uint32 apiVersion = B_BEOS_VERSION);
|
||||
|
||||
/* from BMediaNode */
|
||||
protected:
|
||||
virtual void NodeRegistered();
|
||||
virtual void Start(bigtime_t performance_time);
|
||||
virtual void Stop(bigtime_t performance_time, bool immediate);
|
||||
virtual void Seek(bigtime_t media_time, bigtime_t performance_time);
|
||||
virtual void TimeWarp(bigtime_t at_real_time, bigtime_t to_performance_time);
|
||||
virtual status_t AddTimer(bigtime_t at_performance_time, int32 cookie);
|
||||
virtual void SetRunMode(run_mode mode);
|
||||
|
||||
/* BMediaEventLooper Hook functions */
|
||||
protected:
|
||||
/* you must override to handle your events! */
|
||||
/* you should not call HandleEvent directly */
|
||||
virtual void HandleEvent( const media_timed_event *event,
|
||||
bigtime_t lateness,
|
||||
bool realTimeEvent = false) = 0;
|
||||
|
||||
/* override to clean up custom events you have added to your queue */
|
||||
virtual void CleanUpEvent(const media_timed_event *event);
|
||||
|
||||
/* called from Offline mode to determine the current time of the node */
|
||||
/* update your internal information whenever it changes */
|
||||
virtual bigtime_t OfflineTime();
|
||||
|
||||
/* override only if you know what you are doing! */
|
||||
/* otherwise much badness could occur */
|
||||
/* the actual control loop function: */
|
||||
/* waits for messages, Pops events off the queue and calls DispatchEvent */
|
||||
virtual void ControlLoop();
|
||||
|
||||
thread_id ControlThread();
|
||||
|
||||
protected:
|
||||
BTimedEventQueue * EventQueue();
|
||||
BTimedEventQueue * RealTimeQueue();
|
||||
|
||||
int32 Priority() const;
|
||||
int32 RunState() const;
|
||||
bigtime_t EventLatency() const;
|
||||
bigtime_t BufferDuration() const;
|
||||
bigtime_t SchedulingLatency() const;
|
||||
|
||||
/* use the priority constants from OS.h */
|
||||
/* or suggest_thread_priority from scheduler.h */
|
||||
/* will clamp priorities to be inbetween 5 and 120 */
|
||||
status_t SetPriority(int32 priority);
|
||||
|
||||
/* set the run state */
|
||||
void SetRunState(run_state state);
|
||||
|
||||
/* clamps to 0 if latency < 0 */
|
||||
void SetEventLatency(bigtime_t latency);
|
||||
|
||||
/* clamps to 0 if duration is < 0 */
|
||||
void SetBufferDuration(bigtime_t duration);
|
||||
|
||||
/* set the offline time returned in OfflineTime */
|
||||
void SetOfflineTime(bigtime_t offTime);
|
||||
|
||||
/* spawn and resume the thread - must be called from NodeRegistered */
|
||||
void Run();
|
||||
|
||||
/* close down the thread - must be called from your destructor */
|
||||
void Quit();
|
||||
|
||||
/* calls HandleEvent and does BMediaEventLooper event work */
|
||||
void DispatchEvent( const media_timed_event *event,
|
||||
bigtime_t lateness,
|
||||
bool realTimeEvent = false);
|
||||
|
||||
private:
|
||||
static int32 _ControlThreadStart(void *arg);
|
||||
static void _CleanUpEntry(const media_timed_event *event, void *context);
|
||||
void _DispatchCleanUp(const media_timed_event *event);
|
||||
|
||||
BTimedEventQueue fEventQueue;
|
||||
BTimedEventQueue fRealTimeQueue;
|
||||
thread_id fControlThread;
|
||||
int32 fCurrentPriority;
|
||||
int32 fSetPriority;
|
||||
volatile int32 fRunState;
|
||||
bigtime_t fEventLatency;
|
||||
bigtime_t fSchedulingLatency;
|
||||
bigtime_t fBufferDuration;
|
||||
bigtime_t fOfflineTime;
|
||||
uint32 fApiVersion;
|
||||
|
||||
private:
|
||||
/* unimplemented for your protection */
|
||||
BMediaEventLooper(const BMediaEventLooper&);
|
||||
BMediaEventLooper& operator=(const BMediaEventLooper&);
|
||||
|
||||
protected:
|
||||
virtual status_t DeleteHook(BMediaNode * node);
|
||||
|
||||
/* fragile base class stuffing */
|
||||
private:
|
||||
/* it must be thanksgiving!! lots of stuffing! */
|
||||
virtual status_t _Reserved_BMediaEventLooper_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaEventLooper_23(int32 arg, ...);
|
||||
|
||||
/* turkey for weeks! */
|
||||
bool _reserved_bool_[4];
|
||||
uint32 _reserved_BMediaEventLooper_[12];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,216 +0,0 @@
|
||||
#ifndef _MEDIA_FILE_H
|
||||
#define _MEDIA_FILE_H
|
||||
|
||||
#include <kernel/image.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <StorageDefs.h>
|
||||
#include <List.h>
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaFormats.h>
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
namespace media {
|
||||
class MediaExtractor;
|
||||
}
|
||||
class _IMPEXP_MEDIA MediaWriter;
|
||||
class _AddonManager;
|
||||
}
|
||||
|
||||
|
||||
// forward declarations
|
||||
class BMediaTrack;
|
||||
class BParameterWeb;
|
||||
class BView;
|
||||
|
||||
|
||||
// flags for the BMediaFile constructor
|
||||
enum {
|
||||
B_MEDIA_FILE_REPLACE_MODE = 0x00000001,
|
||||
B_MEDIA_FILE_NO_READ_AHEAD = 0x00000002,
|
||||
B_MEDIA_FILE_UNBUFFERED = 0x00000006,
|
||||
B_MEDIA_FILE_BIG_BUFFERS = 0x00000008
|
||||
};
|
||||
|
||||
// BMediaFile represents a media file (AVI, Quicktime, MPEG, AIFF, WAV, etc)
|
||||
//
|
||||
// To read a file you construct a BMediaFile with an entry_ref, get the
|
||||
// BMediaTracks out of it and use those to read the data.
|
||||
//
|
||||
// To write a file you construct a BMediaFile with an entry ref and an id as
|
||||
// returned by get_next_file_format(). You then CreateTrack() to create
|
||||
// various audio & video tracks. Once you're done creating tracks, call
|
||||
// CommitHeader(), then write data to each track and call CloseFile() when
|
||||
// you're done.
|
||||
//
|
||||
|
||||
class BMediaFile {
|
||||
|
||||
public:
|
||||
// these four constructors are used for read-only access
|
||||
BMediaFile( const entry_ref *ref);
|
||||
BMediaFile( BDataIO * source); // BFile is a BDataIO
|
||||
BMediaFile( const entry_ref * ref,
|
||||
int32 flags);
|
||||
BMediaFile( BDataIO * source,
|
||||
int32 flags); // BFile is a BDataIO
|
||||
|
||||
// these three constructors are for read-write access
|
||||
BMediaFile(const entry_ref *ref, // these two are write-only
|
||||
const media_file_format * mfi,
|
||||
int32 flags=0);
|
||||
BMediaFile(BDataIO *destination, // BFile is a BDataIO
|
||||
const media_file_format * mfi,
|
||||
int32 flags=0);
|
||||
BMediaFile(const media_file_format * mfi, // set file later using SetTo()
|
||||
int32 flags=0);
|
||||
|
||||
status_t SetTo(const entry_ref *ref);
|
||||
status_t SetTo(BDataIO *destination); // BFile is a BDataIO
|
||||
|
||||
virtual ~BMediaFile();
|
||||
|
||||
status_t InitCheck() const;
|
||||
|
||||
// Get info about the underlying file format.
|
||||
status_t GetFileFormatInfo(media_file_format *mfi) const;
|
||||
|
||||
//
|
||||
// These functions are for read-only access to a media file.
|
||||
// The data is read using the BMediaTrack object.
|
||||
//
|
||||
const char *Copyright(void) const;
|
||||
int32 CountTracks() const;
|
||||
|
||||
// Can be called multiple times with the same index. You must call
|
||||
// ReleaseTrack() when you're done with a track.
|
||||
BMediaTrack *TrackAt(int32 index);
|
||||
|
||||
// Release the resource used by a given BMediaTrack object, to reduce
|
||||
// the memory usage of your application. The specific 'track' object
|
||||
// can no longer be used, but you can create another one by calling
|
||||
// TrackAt() with the same track index.
|
||||
status_t ReleaseTrack(BMediaTrack *track);
|
||||
|
||||
// A convenience.
|
||||
status_t ReleaseAllTracks(void);
|
||||
|
||||
|
||||
// Create and add a track to the media file
|
||||
BMediaTrack *CreateTrack(media_format *mf, const media_codec_info *mci, uint32 flags=0);
|
||||
// Create and add a raw track to the media file (it has no encoder)
|
||||
BMediaTrack *CreateTrack(media_format *mf, uint32 flags=0);
|
||||
|
||||
// Lets you set the copyright info for the entire file
|
||||
status_t AddCopyright(const char *data);
|
||||
|
||||
// Call this to add user-defined chunks to a file (if they're supported)
|
||||
status_t AddChunk(int32 type, const void *data, size_t size);
|
||||
|
||||
// After you have added all the tracks you want, call this
|
||||
status_t CommitHeader(void);
|
||||
|
||||
// After you have written all the data to the track objects, call this
|
||||
status_t CloseFile(void);
|
||||
|
||||
// This is for controlling file format parameters
|
||||
|
||||
// returns a copy of the parameter web
|
||||
status_t GetParameterWeb(BParameterWeb** outWeb);
|
||||
status_t GetParameterValue(int32 id, void *valu, size_t *size);
|
||||
status_t SetParameterValue(int32 id, const void *valu, size_t size);
|
||||
BView *GetParameterView();
|
||||
|
||||
// For the future...
|
||||
virtual status_t Perform(int32 selector, void * data);
|
||||
|
||||
private:
|
||||
// deprecated, but for R5 compatibility
|
||||
BParameterWeb *Web();
|
||||
|
||||
// Does nothing, returns B_ERROR, for Zeta compatiblity only
|
||||
status_t ControlFile(int32 selector, void * io_data, size_t size);
|
||||
|
||||
BPrivate::media::MediaExtractor *fExtractor;
|
||||
int32 _reserved_BMediaFile_was_fExtractorID;
|
||||
int32 fTrackNum;
|
||||
status_t fErr;
|
||||
|
||||
BPrivate::_AddonManager *fEncoderMgr;
|
||||
BPrivate::_AddonManager *fWriterMgr;
|
||||
BPrivate::MediaWriter *fWriter;
|
||||
int32 fWriterID;
|
||||
media_file_format fMFI;
|
||||
|
||||
bool fFileClosed;
|
||||
bool fDeleteSource;
|
||||
bool _reserved_was_fUnused[2];
|
||||
BMediaTrack **fTrackList;
|
||||
|
||||
void Init();
|
||||
void InitReader(BDataIO *source, int32 flags = 0);
|
||||
void InitWriter(BDataIO *source, const media_file_format * mfi,
|
||||
int32 flags);
|
||||
|
||||
BMediaFile();
|
||||
BMediaFile(const BMediaFile&);
|
||||
BMediaFile& operator=(const BMediaFile&);
|
||||
|
||||
BDataIO *fSource;
|
||||
|
||||
|
||||
/* fbc data and virtuals */
|
||||
|
||||
uint32 _reserved_BMediaFile_[32];
|
||||
|
||||
virtual status_t _Reserved_BMediaFile_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_23(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_24(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_25(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_26(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_27(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_28(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_29(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_30(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_31(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_32(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_33(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_34(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_35(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_36(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_37(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_38(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_39(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_40(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_41(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_42(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_43(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_44(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_45(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_46(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaFile_47(int32 arg, ...);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,77 +0,0 @@
|
||||
/* MediaFiles.h */
|
||||
/* Copyright 1998 Be Incorporated. All rights reserved. */
|
||||
|
||||
#if !defined(_MEDIA_FILES_H)
|
||||
#define _MEDIA_FILES_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <List.h>
|
||||
|
||||
struct entry_ref;
|
||||
|
||||
#include <String.h>
|
||||
|
||||
class BMediaFiles {
|
||||
public:
|
||||
|
||||
BMediaFiles();
|
||||
virtual ~BMediaFiles();
|
||||
|
||||
virtual status_t RewindTypes();
|
||||
virtual status_t GetNextType(
|
||||
BString * out_type);
|
||||
|
||||
virtual status_t RewindRefs(
|
||||
const char * type);
|
||||
virtual status_t GetNextRef(
|
||||
BString * out_type,
|
||||
entry_ref * out_ref = NULL);
|
||||
|
||||
virtual status_t GetRefFor(
|
||||
const char * type,
|
||||
const char * item,
|
||||
entry_ref * out_ref);
|
||||
status_t GetAudioGainFor(
|
||||
const char * type,
|
||||
const char * item,
|
||||
float * out_audio_gain);
|
||||
virtual status_t SetRefFor(
|
||||
const char * type,
|
||||
const char * item,
|
||||
const entry_ref & ref);
|
||||
status_t SetAudioGainFor(
|
||||
const char * type,
|
||||
const char * item,
|
||||
float audio_gain);
|
||||
virtual status_t RemoveRefFor( // This might better be called "ClearRefFor"
|
||||
const char * type, // but it's too late now...
|
||||
const char * item,
|
||||
const entry_ref & ref);
|
||||
|
||||
static const char B_SOUNDS[]; /* for "types" */
|
||||
|
||||
virtual status_t RemoveItem( // new in 4.1, removes the whole item.
|
||||
const char * type,
|
||||
const char * item);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
status_t _Reserved_MediaFiles_0(void *, ...);
|
||||
virtual status_t _Reserved_MediaFiles_1(void *, ...);
|
||||
virtual status_t _Reserved_MediaFiles_2(void *, ...);
|
||||
virtual status_t _Reserved_MediaFiles_3(void *, ...);
|
||||
virtual status_t _Reserved_MediaFiles_4(void *, ...);
|
||||
virtual status_t _Reserved_MediaFiles_5(void *, ...);
|
||||
virtual status_t _Reserved_MediaFiles_6(void *, ...);
|
||||
virtual status_t _Reserved_MediaFiles_7(void *, ...);
|
||||
|
||||
BList m_types;
|
||||
int m_type_index;
|
||||
BString m_cur_type;
|
||||
BList m_items;
|
||||
int m_item_index;
|
||||
};
|
||||
|
||||
#endif /* _MEDIA_FILES_H */
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
/* MediaFormats.h */
|
||||
/* Copyright 1998 Be Incorporated. All rights reserved. */
|
||||
|
||||
#if !defined(_MEDIA_TYPES_H)
|
||||
#define _MEDIA_TYPES_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#include <MediaDefs.h>
|
||||
|
||||
#include <Messenger.h>
|
||||
#include <List.h>
|
||||
#include <Locker.h>
|
||||
#endif
|
||||
|
||||
|
||||
struct media_codec_info {
|
||||
char pretty_name[96]; // eg: "SuperSqueeze Encoder by Foo Inc"
|
||||
char short_name[32]; // eg: "supersqueeze"
|
||||
|
||||
int32 id; // opaque id passed to BMediaFile::CreateTrack
|
||||
int32 sub_id;
|
||||
|
||||
int32 pad[63];
|
||||
};
|
||||
|
||||
//
|
||||
// Use this to iterate through the available encoders for a file format.
|
||||
//
|
||||
status_t get_next_encoder(int32 *cookie,
|
||||
const media_file_format *fileFormat,// this comes from get_next_file_format()
|
||||
const media_format *inFormat, // this is the type of data given to the encoder
|
||||
media_format *_outFormat, // this is the type of data encoder will output
|
||||
media_codec_info *_codecInfo); // information about the encoder
|
||||
|
||||
status_t get_next_encoder(
|
||||
int32 *cookie,
|
||||
const media_file_format *fileFormat,// this comes from get_next_file_format()
|
||||
// pass NULL if you don't care
|
||||
const media_format *inFormat, // this is the type of data given to the
|
||||
// encoder, wildcards are accepted
|
||||
const media_format *_outFormat, // this is the type of data encoder
|
||||
// you want the encoder to output.
|
||||
// Wildcards are accepted
|
||||
media_codec_info *codecInfo, // information about the encoder
|
||||
media_format *_acceptedInputFormat, // this is the type of data that the
|
||||
// encoder will accept as input.
|
||||
// Wildcards in input_format will be
|
||||
// specialized here.
|
||||
media_format *_acceptedOutputFormat // this is the type of data that the
|
||||
// encoder will output.
|
||||
// Wildcards in output_format will be
|
||||
// specialized here.
|
||||
);
|
||||
|
||||
status_t get_next_encoder(int32 *cookie, media_codec_info *_codecInfo);
|
||||
|
||||
|
||||
enum media_file_accept_format_flags {
|
||||
B_MEDIA_REJECT_WILDCARDS = 0x1
|
||||
};
|
||||
|
||||
bool does_file_accept_format(const media_file_format *fileFormat,
|
||||
media_format *format, uint32 flags = 0);
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8 data[16];
|
||||
} GUID;
|
||||
|
||||
enum beos_format {
|
||||
B_BEOS_FORMAT_RAW_AUDIO = 'rawa',
|
||||
B_BEOS_FORMAT_RAW_VIDEO = 'rawv'
|
||||
};
|
||||
typedef struct {
|
||||
int32 format;
|
||||
} media_beos_description;
|
||||
|
||||
typedef struct {
|
||||
uint32 codec;
|
||||
uint32 vendor;
|
||||
} media_quicktime_description;
|
||||
|
||||
typedef struct {
|
||||
uint32 codec;
|
||||
} media_avi_description;
|
||||
|
||||
typedef struct {
|
||||
uint32 id;
|
||||
} media_avr_description;
|
||||
|
||||
typedef struct {
|
||||
GUID guid;
|
||||
} media_asf_description;
|
||||
|
||||
enum mpeg_id {
|
||||
B_MPEG_ANY = 0,
|
||||
B_MPEG_1_AUDIO_LAYER_1 = 0x101,
|
||||
B_MPEG_1_AUDIO_LAYER_2 = 0x102,
|
||||
B_MPEG_1_AUDIO_LAYER_3 = 0x103, // "MP3"
|
||||
B_MPEG_1_VIDEO = 0x111,
|
||||
B_MPEG_2_AUDIO_LAYER_1 = 0x201,
|
||||
B_MPEG_2_AUDIO_LAYER_2 = 0x202,
|
||||
B_MPEG_2_AUDIO_LAYER_3 = 0x203,
|
||||
B_MPEG_2_VIDEO = 0x211,
|
||||
B_MPEG_2_5_AUDIO_LAYER_1 = 0x301,
|
||||
B_MPEG_2_5_AUDIO_LAYER_2 = 0x302,
|
||||
B_MPEG_2_5_AUDIO_LAYER_3 = 0x303,
|
||||
};
|
||||
typedef struct {
|
||||
uint32 id;
|
||||
} media_mpeg_description;
|
||||
|
||||
typedef struct {
|
||||
uint32 codec;
|
||||
} media_wav_description;
|
||||
|
||||
typedef struct {
|
||||
uint32 codec;
|
||||
} media_aiff_description;
|
||||
|
||||
typedef struct {
|
||||
uint32 file_format;
|
||||
uint32 codec;
|
||||
} media_misc_description;
|
||||
|
||||
typedef struct _media_format_description {
|
||||
#if defined(__cplusplus)
|
||||
_media_format_description();
|
||||
~_media_format_description();
|
||||
_media_format_description(const _media_format_description & other);
|
||||
_media_format_description & operator=(const _media_format_description & other);
|
||||
#endif
|
||||
media_format_family family;
|
||||
uint32 _reserved_[3];
|
||||
union {
|
||||
media_beos_description beos;
|
||||
media_quicktime_description quicktime;
|
||||
media_avi_description avi;
|
||||
media_asf_description asf;
|
||||
media_mpeg_description mpeg;
|
||||
media_wav_description wav;
|
||||
media_aiff_description aiff;
|
||||
media_misc_description misc;
|
||||
media_avr_description avr;
|
||||
uint32 _reserved_[12];
|
||||
} u;
|
||||
} media_format_description;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
|
||||
class BMediaFormats {
|
||||
public:
|
||||
BMediaFormats();
|
||||
virtual ~BMediaFormats();
|
||||
|
||||
status_t InitCheck();
|
||||
|
||||
// Make sure you memset() your descs to 0 before you start filling
|
||||
// them in! Else you may register some bogus value.
|
||||
enum make_format_flags {
|
||||
B_EXCLUSIVE = 0x1, // Fail if this format has already been registered
|
||||
B_NO_MERGE = 0x2, // Don't re-number any formats if there are multiple
|
||||
// clashing previous registrations, but fail instead
|
||||
B_SET_DEFAULT = 0x4 // Set the first format to be the default for the
|
||||
// format family (when registering more than one in
|
||||
// the same family). Only use in Encoder add-ons.
|
||||
};
|
||||
|
||||
status_t MakeFormatFor(const media_format_description *descriptions,
|
||||
int32 descriptionCount, media_format *inOutFormat,
|
||||
uint32 flags = 0, void * _reserved = 0);
|
||||
status_t GetFormatFor(const media_format_description &description,
|
||||
media_format *_outFormat);
|
||||
|
||||
status_t GetCodeFor(const media_format &format,
|
||||
media_format_family family, media_format_description *_outDescription);
|
||||
|
||||
status_t RewindFormats();
|
||||
status_t GetNextFormat(media_format *_outFormat,
|
||||
media_format_description *_outDescription);
|
||||
|
||||
// You need to lock/unlock (only) when using RewindFormats()/GetNextFormat()
|
||||
bool Lock();
|
||||
void Unlock();
|
||||
|
||||
// convenience functions
|
||||
static status_t GetBeOSFormatFor(uint32 fourcc,
|
||||
media_format *_outFormat, media_type type = B_MEDIA_UNKNOWN_TYPE);
|
||||
static status_t GetAVIFormatFor(uint32 fourcc,
|
||||
media_format *_outFormat, media_type type = B_MEDIA_UNKNOWN_TYPE);
|
||||
static status_t GetQuicktimeFormatFor(uint32 vendor, uint32 fourcc,
|
||||
media_format *_outFormat, media_type type = B_MEDIA_UNKNOWN_TYPE);
|
||||
|
||||
/* --- begin deprecated API --- */
|
||||
|
||||
status_t MakeFormatFor(const media_format_description &description,
|
||||
const media_format &inFormat, media_format *_outFormat);
|
||||
|
||||
private:
|
||||
int32 fIteratorIndex;
|
||||
uint32 _reserved[30];
|
||||
};
|
||||
|
||||
_IMPEXP_MEDIA bool operator==(const media_format_description & a, const media_format_description & b);
|
||||
_IMPEXP_MEDIA bool operator<(const media_format_description & a, const media_format_description & b);
|
||||
|
||||
_IMPEXP_MEDIA bool operator==(const GUID & a, const GUID & b);
|
||||
_IMPEXP_MEDIA bool operator<(const GUID & a, const GUID & b);
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _MEDIA_TYPES_H */
|
||||
|
||||
@@ -1,356 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: MediaNode.h
|
||||
/
|
||||
/ Description: BMediaNode is the indirect base class for all Media Kit participants.
|
||||
/ However, you should use the more specific BBufferConsumer, BBufferProducer
|
||||
/ and others rather than BMediaNode directly. It's OK to multiply inherit.
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#if !defined(_MEDIA_NODE_H)
|
||||
#define _MEDIA_NODE_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <Point.h>
|
||||
|
||||
#include <new>
|
||||
|
||||
class BMediaAddOn;
|
||||
|
||||
|
||||
|
||||
class media_node {
|
||||
|
||||
public:
|
||||
|
||||
media_node();
|
||||
~media_node();
|
||||
|
||||
media_node_id node;
|
||||
port_id port;
|
||||
uint32 kind;
|
||||
|
||||
static media_node null;
|
||||
|
||||
private:
|
||||
uint32 _reserved_[3];
|
||||
};
|
||||
|
||||
|
||||
struct media_input {
|
||||
media_input();
|
||||
~media_input();
|
||||
media_node node;
|
||||
media_source source;
|
||||
media_destination destination;
|
||||
media_format format;
|
||||
char name[B_MEDIA_NAME_LENGTH];
|
||||
private:
|
||||
uint32 _reserved_media_input_[4];
|
||||
};
|
||||
|
||||
struct media_output {
|
||||
media_output();
|
||||
~media_output();
|
||||
media_node node;
|
||||
media_source source;
|
||||
media_destination destination;
|
||||
media_format format;
|
||||
char name[B_MEDIA_NAME_LENGTH];
|
||||
private:
|
||||
uint32 _reserved_media_output_[4];
|
||||
};
|
||||
|
||||
struct live_node_info {
|
||||
live_node_info();
|
||||
~live_node_info();
|
||||
media_node node;
|
||||
BPoint hint_point;
|
||||
char name[B_MEDIA_NAME_LENGTH];
|
||||
private:
|
||||
char reserved[160];
|
||||
};
|
||||
|
||||
|
||||
struct media_request_info
|
||||
{
|
||||
enum what_code
|
||||
{
|
||||
B_SET_VIDEO_CLIPPING_FOR = 1,
|
||||
B_REQUEST_FORMAT_CHANGE,
|
||||
B_SET_OUTPUT_ENABLED,
|
||||
B_SET_OUTPUT_BUFFERS_FOR,
|
||||
|
||||
B_FORMAT_CHANGED = 4097
|
||||
};
|
||||
what_code what;
|
||||
int32 change_tag;
|
||||
status_t status;
|
||||
int32 cookie;
|
||||
void * user_data;
|
||||
media_source source;
|
||||
media_destination destination;
|
||||
media_format format;
|
||||
uint32 _reserved_[32];
|
||||
};
|
||||
|
||||
struct media_node_attribute
|
||||
{
|
||||
enum {
|
||||
B_R40_COMPILED = 1, // has this attribute if compiled using R4.0 headers
|
||||
B_USER_ATTRIBUTE_NAME = 0x1000000,
|
||||
B_FIRST_USER_ATTRIBUTE
|
||||
};
|
||||
uint32 what;
|
||||
uint32 flags; // per attribute
|
||||
int64 data; // per attribute
|
||||
};
|
||||
|
||||
|
||||
namespace BPrivate { namespace media {
|
||||
class TimeSourceObject;
|
||||
class SystemTimeSourceObject;
|
||||
class BMediaRosterEx;
|
||||
} } // BPrivate::media
|
||||
|
||||
|
||||
class BMediaNode
|
||||
{
|
||||
protected:
|
||||
/* this has to be on top rather than bottom to force a vtable in mwcc */
|
||||
virtual ~BMediaNode(); /* should be called through Release() */
|
||||
public:
|
||||
|
||||
enum run_mode {
|
||||
B_OFFLINE = 1, /* data accurate, no realtime constraint */
|
||||
B_DECREASE_PRECISION, /* when slipping, try to catch up */
|
||||
B_INCREASE_LATENCY, /* when slipping, increase playout delay */
|
||||
B_DROP_DATA, /* when slipping, skip data */
|
||||
B_RECORDING /* you're on the receiving end of recording; buffers are guaranteed to be late */
|
||||
};
|
||||
|
||||
|
||||
BMediaNode * Acquire(); /* return itself */
|
||||
BMediaNode * Release(); /* release will decrement refcount, and delete if 0 */
|
||||
|
||||
const char * Name() const;
|
||||
media_node_id ID() const;
|
||||
uint64 Kinds() const;
|
||||
media_node Node() const;
|
||||
run_mode RunMode() const;
|
||||
BTimeSource * TimeSource() const;
|
||||
|
||||
/* this port is what a media node listens to for commands */
|
||||
virtual port_id ControlPort() const;
|
||||
|
||||
virtual BMediaAddOn* AddOn(
|
||||
int32 * internal_id) const = 0; /* Who instantiated you -- or NULL for app class */
|
||||
|
||||
/* These will be sent to anyone watching the MediaRoster. */
|
||||
/* The message field "be:node_id" will contain the node ID. */
|
||||
enum node_error {
|
||||
/* Note that these belong with the notifications in MediaDefs.h! */
|
||||
/* They are here to provide compiler type checking in ReportError(). */
|
||||
B_NODE_FAILED_START = 'TRI0',
|
||||
B_NODE_FAILED_STOP, // TRI1
|
||||
B_NODE_FAILED_SEEK, // TRI2
|
||||
B_NODE_FAILED_SET_RUN_MODE, // TRI3
|
||||
B_NODE_FAILED_TIME_WARP, // TRI4
|
||||
B_NODE_FAILED_PREROLL, // TRI5
|
||||
B_NODE_FAILED_SET_TIME_SOURCE_FOR, // TRI6
|
||||
/* display this node with a blinking exclamation mark or something */
|
||||
B_NODE_IN_DISTRESS // TRI7
|
||||
/* TRIA and up are used in MediaDefs.h */
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
/* Send one of the above codes to anybody who's watching. */
|
||||
status_t ReportError(
|
||||
node_error what,
|
||||
const BMessage * info = NULL); /* String "message" for instance */
|
||||
|
||||
/* When you've handled a stop request, call this function. If anyone is */
|
||||
/* listening for stop information from you, they will be notified. Especially */
|
||||
/* important for offline capable Nodes. */
|
||||
status_t NodeStopped(
|
||||
bigtime_t whenPerformance); // performance time
|
||||
void TimerExpired(
|
||||
bigtime_t notifyPoint, // performance time
|
||||
int32 cookie,
|
||||
status_t error = B_OK);
|
||||
|
||||
explicit BMediaNode( /* constructor sets refcount to 1 */
|
||||
const char * name);
|
||||
|
||||
status_t WaitForMessage(
|
||||
bigtime_t waitUntil,
|
||||
uint32 flags = 0,
|
||||
void * _reserved_ = 0);
|
||||
|
||||
/* These don't return errors; instead, they use the global error condition reporter. */
|
||||
/* A node is required to have a queue of at least one pending command (plus TimeWarp) */
|
||||
/* and is recommended to allow for at least one pending command of each type. */
|
||||
/* Allowing an arbitrary number of outstanding commands might be nice, but apps */
|
||||
/* cannot depend on that happening. */
|
||||
virtual void Start(
|
||||
bigtime_t performance_time);
|
||||
virtual void Stop(
|
||||
bigtime_t performance_time,
|
||||
bool immediate);
|
||||
virtual void Seek(
|
||||
bigtime_t media_time,
|
||||
bigtime_t performance_time);
|
||||
virtual void SetRunMode(
|
||||
run_mode mode);
|
||||
virtual void TimeWarp(
|
||||
bigtime_t at_real_time,
|
||||
bigtime_t to_performance_time);
|
||||
virtual void Preroll();
|
||||
virtual void SetTimeSource(
|
||||
BTimeSource * time_source);
|
||||
|
||||
public:
|
||||
|
||||
virtual status_t HandleMessage(
|
||||
int32 message,
|
||||
const void * data,
|
||||
size_t size);
|
||||
void HandleBadMessage( /* call this with messages you and your superclasses don't recognize */
|
||||
int32 code,
|
||||
const void * buffer,
|
||||
size_t size);
|
||||
|
||||
/* Called from derived system classes; you don't need to */
|
||||
void AddNodeKind(
|
||||
uint64 kind);
|
||||
|
||||
// These were not in 4.0.
|
||||
// We added them in 4.1 for future use. They just call
|
||||
// the default global versions for now.
|
||||
void * operator new(
|
||||
size_t size);
|
||||
void * operator new(
|
||||
size_t size,
|
||||
const nothrow_t &) throw();
|
||||
void operator delete(
|
||||
void * ptr);
|
||||
#if !__MWERKS__
|
||||
// there's a bug in MWCC under R4.1 and earlier
|
||||
void operator delete(
|
||||
void * ptr,
|
||||
const nothrow_t &) throw();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
/* Called when requests have completed, or failed. */
|
||||
virtual status_t RequestCompleted( /* reserved 0 */
|
||||
const media_request_info & info);
|
||||
|
||||
private:
|
||||
friend class BTimeSource;
|
||||
friend class BMediaRoster;
|
||||
friend class BBufferProducer; // for getting _mNodeID
|
||||
friend class BPrivate::media::TimeSourceObject;
|
||||
friend class BPrivate::media::SystemTimeSourceObject;
|
||||
friend class BPrivate::media::BMediaRosterEx;
|
||||
|
||||
// Deprecated in 4.1
|
||||
int32 IncrementChangeTag();
|
||||
int32 ChangeTag();
|
||||
int32 MintChangeTag();
|
||||
status_t ApplyChangeTag(
|
||||
int32 previously_reserved);
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
protected:
|
||||
|
||||
virtual status_t DeleteHook(BMediaNode * node); /* reserved 1 */
|
||||
|
||||
virtual void NodeRegistered(); /* reserved 2 */
|
||||
|
||||
public:
|
||||
|
||||
/* fill out your attributes in the provided array, returning however many you have. */
|
||||
virtual status_t GetNodeAttributes( /* reserved 3 */
|
||||
media_node_attribute * outAttributes,
|
||||
size_t inMaxCount);
|
||||
|
||||
virtual status_t AddTimer(
|
||||
bigtime_t at_performance_time,
|
||||
int32 cookie);
|
||||
|
||||
private:
|
||||
|
||||
status_t _Reserved_MediaNode_0(void *); /* DeleteHook() */
|
||||
status_t _Reserved_MediaNode_1(void *); /* RequestCompletionHook() */
|
||||
status_t _Reserved_MediaNode_2(void *); /* NodeRegistered() */
|
||||
status_t _Reserved_MediaNode_3(void *); /* GetNodeAttributes() */
|
||||
status_t _Reserved_MediaNode_4(void *); /* AddTimer() */
|
||||
virtual status_t _Reserved_MediaNode_5(void *);
|
||||
virtual status_t _Reserved_MediaNode_6(void *);
|
||||
virtual status_t _Reserved_MediaNode_7(void *);
|
||||
virtual status_t _Reserved_MediaNode_8(void *);
|
||||
virtual status_t _Reserved_MediaNode_9(void *);
|
||||
virtual status_t _Reserved_MediaNode_10(void *);
|
||||
virtual status_t _Reserved_MediaNode_11(void *);
|
||||
virtual status_t _Reserved_MediaNode_12(void *);
|
||||
virtual status_t _Reserved_MediaNode_13(void *);
|
||||
virtual status_t _Reserved_MediaNode_14(void *);
|
||||
virtual status_t _Reserved_MediaNode_15(void *);
|
||||
|
||||
BMediaNode(); /* private unimplemented */
|
||||
BMediaNode(
|
||||
const BMediaNode & clone);
|
||||
BMediaNode & operator=(
|
||||
const BMediaNode & clone);
|
||||
|
||||
BMediaNode( /* constructor sets refcount to 1 */
|
||||
const char * name,
|
||||
media_node_id id,
|
||||
uint32 kinds);
|
||||
|
||||
void _InitObject(const char *, media_node_id, uint64);
|
||||
|
||||
media_node_id fNodeID;
|
||||
BTimeSource * fTimeSource;
|
||||
int32 fRefCount;
|
||||
char fName[B_MEDIA_NAME_LENGTH];
|
||||
run_mode fRunMode;
|
||||
int32 _mChangeCount; // deprecated
|
||||
int32 _mChangeCountReserved; // deprecated
|
||||
uint64 fKinds;
|
||||
media_node_id fTimeSourceID;
|
||||
|
||||
BBufferProducer * fProducerThis;
|
||||
BBufferConsumer * fConsumerThis;
|
||||
BFileInterface * fFileInterfaceThis;
|
||||
BControllable * fControllableThis;
|
||||
BTimeSource * fTimeSourceThis;
|
||||
|
||||
bool _mReservedBool[4];
|
||||
|
||||
mutable port_id fControlPort;
|
||||
|
||||
uint32 _reserved_media_node_[8];
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
static int32 NewChangeTag(); // for use by BBufferConsumer, mostly
|
||||
|
||||
private:
|
||||
// dont' rename this one, it's static and needed for binary compatibility
|
||||
static int32 _m_changeTag; // not to be confused with _mChangeCount
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* _MEDIA_NODE_H */
|
||||
|
||||
@@ -1,426 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: MediaRoster.h
|
||||
/
|
||||
/ Description: The BMediaRoster is the main application interface to the Media Kit
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_MEDIA_ROSTER_H)
|
||||
#define _MEDIA_ROSTER_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaNode.h>
|
||||
#include <config_manager.h>
|
||||
|
||||
class BMimeType;
|
||||
struct dormant_flavor_info;
|
||||
class BMediaAddOn;
|
||||
|
||||
namespace BPrivate { namespace media {
|
||||
class DefaultDeleter;
|
||||
class BMediaRosterEx;
|
||||
} } // BPrivate::media
|
||||
|
||||
class BMediaRoster : public BLooper
|
||||
{
|
||||
public:
|
||||
|
||||
status_t GetVideoInput(
|
||||
media_node * out_node);
|
||||
status_t GetAudioInput(
|
||||
media_node * out_node);
|
||||
status_t GetVideoOutput(
|
||||
media_node * out_node);
|
||||
status_t GetAudioMixer(
|
||||
media_node * out_node);
|
||||
status_t GetAudioOutput(
|
||||
media_node * out_node); /* Use the mixer rather than the output for most needs! */
|
||||
status_t GetAudioOutput(
|
||||
media_node * out_node,
|
||||
int32 * out_input_id,
|
||||
BString * out_input_name);
|
||||
status_t GetTimeSource(
|
||||
media_node * out_node);
|
||||
|
||||
status_t SetVideoInput(
|
||||
const media_node & producer);
|
||||
status_t SetVideoInput(
|
||||
const dormant_node_info & producer);
|
||||
status_t SetAudioInput(
|
||||
const media_node & producer);
|
||||
status_t SetAudioInput(
|
||||
const dormant_node_info & producer);
|
||||
status_t SetVideoOutput(
|
||||
const media_node & consumer);
|
||||
status_t SetVideoOutput(
|
||||
const dormant_node_info & consumer);
|
||||
status_t SetAudioOutput(
|
||||
const media_node & consumer);
|
||||
status_t SetAudioOutput(
|
||||
const media_input & input_to_output);
|
||||
status_t SetAudioOutput(
|
||||
const dormant_node_info & consumer);
|
||||
|
||||
/* Get a media_node from a node ID -- this is how you reference your own nodes! */
|
||||
status_t GetNodeFor(
|
||||
media_node_id node,
|
||||
media_node * clone);
|
||||
status_t GetSystemTimeSource( /* typically, you want to use GetTimeSource() */
|
||||
media_node * clone);
|
||||
status_t ReleaseNode( /* might shut down Node if you're last */
|
||||
const media_node & node);
|
||||
|
||||
BTimeSource * MakeTimeSourceFor( /* Release() the object when done */
|
||||
const media_node & for_node);
|
||||
|
||||
/* note that the media_source and media_destination found in */
|
||||
/* out_output and out_input are the ones actually used; from and to */
|
||||
/* are only "hints" that the app should not use once a real connection */
|
||||
/* has been established */
|
||||
status_t Connect(
|
||||
const media_source & from,
|
||||
const media_destination & to,
|
||||
media_format * io_format,
|
||||
media_output * out_output,
|
||||
media_input * out_input);
|
||||
enum connect_flags {
|
||||
B_CONNECT_MUTED = 0x1
|
||||
};
|
||||
status_t Connect(
|
||||
const media_source & from,
|
||||
const media_destination & to,
|
||||
media_format * io_format,
|
||||
media_output * out_output,
|
||||
media_input * out_input,
|
||||
uint32 in_flags,
|
||||
void * _reserved = 0);
|
||||
status_t Disconnect(
|
||||
media_node_id source_node,
|
||||
const media_source & source,
|
||||
media_node_id destination_node,
|
||||
const media_destination & destination);
|
||||
|
||||
status_t StartNode(
|
||||
const media_node & node,
|
||||
bigtime_t at_performance_time);
|
||||
status_t StopNode(
|
||||
const media_node & node,
|
||||
bigtime_t at_performance_time,
|
||||
bool immediate = false); /* immediate -> at_time is insignificant */
|
||||
status_t SeekNode(
|
||||
const media_node & node,
|
||||
bigtime_t to_media_time,
|
||||
bigtime_t at_performance_time = 0 /* if running */ );
|
||||
|
||||
status_t StartTimeSource(
|
||||
const media_node & node,
|
||||
bigtime_t at_real_time);
|
||||
status_t StopTimeSource(
|
||||
const media_node & node,
|
||||
bigtime_t at_real_time,
|
||||
bool immediate = false);
|
||||
status_t SeekTimeSource(
|
||||
const media_node & node,
|
||||
bigtime_t to_performance_time,
|
||||
bigtime_t at_real_time);
|
||||
|
||||
status_t SyncToNode(
|
||||
const media_node & node,
|
||||
bigtime_t at_time,
|
||||
bigtime_t timeout = B_INFINITE_TIMEOUT);
|
||||
status_t SetRunModeNode(
|
||||
const media_node & node,
|
||||
BMediaNode::run_mode mode);
|
||||
status_t PrerollNode( /* synchronous */
|
||||
const media_node & node);
|
||||
|
||||
status_t RollNode(
|
||||
const media_node & node,
|
||||
bigtime_t startPerformance,
|
||||
bigtime_t stopPerformance,
|
||||
bigtime_t atMediaTime = -B_INFINITE_TIMEOUT);
|
||||
|
||||
status_t SetProducerRunModeDelay( /* should only be used with B_RECORDING */
|
||||
const media_node & node,
|
||||
bigtime_t delay,
|
||||
BMediaNode::run_mode mode = BMediaNode::B_RECORDING);
|
||||
status_t SetProducerRate( /* not necessarily supported by node */
|
||||
const media_node & producer,
|
||||
int32 numer,
|
||||
int32 denom);
|
||||
|
||||
/* Nodes will have available inputs/outputs as long as they are capable */
|
||||
/* of accepting more connections. The node may create an additional */
|
||||
/* output or input as the currently available is taken into usage. */
|
||||
status_t GetLiveNodeInfo(
|
||||
const media_node & node,
|
||||
live_node_info * out_live_info);
|
||||
status_t GetLiveNodes(
|
||||
live_node_info * out_live_nodes,
|
||||
int32 * io_total_count,
|
||||
const media_format * has_input = NULL,
|
||||
const media_format * has_output = NULL,
|
||||
const char * name = NULL,
|
||||
uint64 node_kinds = 0); /* B_BUFFER_PRODUCER etc */
|
||||
|
||||
status_t GetFreeInputsFor(
|
||||
const media_node & node,
|
||||
media_input * out_free_inputs,
|
||||
int32 buf_num_inputs,
|
||||
int32 * out_total_count,
|
||||
media_type filter_type = B_MEDIA_UNKNOWN_TYPE);
|
||||
status_t GetConnectedInputsFor(
|
||||
const media_node & node,
|
||||
media_input * out_active_inputs,
|
||||
int32 buf_num_inputs,
|
||||
int32 * out_total_count);
|
||||
status_t GetAllInputsFor(
|
||||
const media_node & node,
|
||||
media_input * out_inputs,
|
||||
int32 buf_num_inputs,
|
||||
int32 * out_total_count);
|
||||
status_t GetFreeOutputsFor(
|
||||
const media_node & node,
|
||||
media_output * out_free_outputs,
|
||||
int32 buf_num_outputs,
|
||||
int32 * out_total_count,
|
||||
media_type filter_type = B_MEDIA_UNKNOWN_TYPE);
|
||||
status_t GetConnectedOutputsFor(
|
||||
const media_node & node,
|
||||
media_output * out_active_outputs,
|
||||
int32 buf_num_outputs,
|
||||
int32 * out_total_count);
|
||||
status_t GetAllOutputsFor(
|
||||
const media_node & node,
|
||||
media_output * out_outputs,
|
||||
int32 buf_num_outputs,
|
||||
int32 * out_total_count);
|
||||
|
||||
status_t StartWatching(
|
||||
const BMessenger & where);
|
||||
status_t StartWatching(
|
||||
const BMessenger & where,
|
||||
int32 notificationType);
|
||||
status_t StartWatching(
|
||||
const BMessenger & where,
|
||||
const media_node & node,
|
||||
int32 notificationType);
|
||||
status_t StopWatching(
|
||||
const BMessenger & where);
|
||||
status_t StopWatching(
|
||||
const BMessenger & where,
|
||||
int32 notificationType);
|
||||
status_t StopWatching(
|
||||
const BMessenger & where,
|
||||
const media_node & node,
|
||||
int32 notificationType);
|
||||
|
||||
status_t RegisterNode(
|
||||
BMediaNode * node);
|
||||
status_t UnregisterNode(
|
||||
BMediaNode * node);
|
||||
|
||||
static BMediaRoster * Roster( // will create if there isn't one
|
||||
status_t * out_error = NULL); // thread safe for multiple calls to Roster()
|
||||
static BMediaRoster * CurrentRoster(); // won't create it if there isn't one
|
||||
// not thread safe if you call Roster() at the same time
|
||||
status_t SetTimeSourceFor(
|
||||
media_node_id node,
|
||||
media_node_id time_source);
|
||||
|
||||
status_t GetParameterWebFor(
|
||||
const media_node & node,
|
||||
BParameterWeb ** out_web);
|
||||
status_t StartControlPanel(
|
||||
const media_node & node,
|
||||
BMessenger * out_messenger = NULL);
|
||||
|
||||
status_t GetDormantNodes(
|
||||
dormant_node_info * out_info,
|
||||
int32 * io_count,
|
||||
const media_format * has_input = NULL,
|
||||
const media_format * has_output = NULL,
|
||||
const char * name = NULL,
|
||||
uint64 require_kinds = 0,
|
||||
uint64 deny_kinds = 0);
|
||||
status_t InstantiateDormantNode(
|
||||
const dormant_node_info & in_info,
|
||||
media_node * out_node,
|
||||
uint32 flags /* currently B_FLAVOR_IS_GLOBAL or B_FLAVOR_IS_LOCAL */ );
|
||||
status_t InstantiateDormantNode(
|
||||
const dormant_node_info & in_info,
|
||||
media_node * out_node);
|
||||
status_t GetDormantNodeFor(
|
||||
const media_node & node,
|
||||
dormant_node_info * out_info);
|
||||
status_t GetDormantFlavorInfoFor(
|
||||
const dormant_node_info & in_dormant,
|
||||
dormant_flavor_info * out_flavor);
|
||||
|
||||
status_t GetLatencyFor(
|
||||
const media_node & producer,
|
||||
bigtime_t * out_latency);
|
||||
status_t GetInitialLatencyFor(
|
||||
const media_node & producer,
|
||||
bigtime_t * out_latency,
|
||||
uint32 * out_flags = 0);
|
||||
status_t GetStartLatencyFor(
|
||||
const media_node & time_source,
|
||||
bigtime_t * out_latency);
|
||||
|
||||
status_t GetFileFormatsFor(
|
||||
const media_node & file_interface,
|
||||
media_file_format * out_formats,
|
||||
int32 * io_num_infos);
|
||||
status_t SetRefFor(
|
||||
const media_node & file_interface,
|
||||
const entry_ref & file,
|
||||
bool create_and_truncate,
|
||||
bigtime_t * out_length); /* if create is false */
|
||||
status_t GetRefFor(
|
||||
const media_node & node,
|
||||
entry_ref * out_file,
|
||||
BMimeType * mime_type = NULL);
|
||||
status_t SniffRefFor(
|
||||
const media_node & file_interface,
|
||||
const entry_ref & file,
|
||||
BMimeType * mime_type,
|
||||
float * out_capability);
|
||||
/* This is the generic "here's a file, now can someone please play it" interface */
|
||||
status_t SniffRef(
|
||||
const entry_ref & file,
|
||||
uint64 require_node_kinds, /* if you need an EntityInterface or BufferConsumer or something */
|
||||
dormant_node_info * out_node,
|
||||
BMimeType * mime_type = NULL);
|
||||
status_t GetDormantNodeForType(
|
||||
const BMimeType & type,
|
||||
uint64 require_node_kinds,
|
||||
dormant_node_info * out_node);
|
||||
status_t GetReadFileFormatsFor(
|
||||
const dormant_node_info & in_node,
|
||||
media_file_format * out_read_formats,
|
||||
int32 in_read_count,
|
||||
int32 * out_read_count);
|
||||
status_t GetWriteFileFormatsFor(
|
||||
const dormant_node_info & in_node,
|
||||
media_file_format * out_write_formats,
|
||||
int32 in_write_count,
|
||||
int32 * out_write_count);
|
||||
|
||||
status_t GetFormatFor(
|
||||
const media_output & output,
|
||||
media_format * io_format,
|
||||
uint32 flags = 0);
|
||||
status_t GetFormatFor(
|
||||
const media_input & input,
|
||||
media_format * io_format,
|
||||
uint32 flags = 0);
|
||||
status_t GetFormatFor(
|
||||
const media_node & node,
|
||||
media_format * io_format,
|
||||
float quality = B_MEDIA_ANY_QUALITY);
|
||||
ssize_t GetNodeAttributesFor(
|
||||
const media_node & node,
|
||||
media_node_attribute * outArray,
|
||||
size_t inMaxCount);
|
||||
media_node_id NodeIDFor(
|
||||
port_id source_or_destination_port);
|
||||
status_t GetInstancesFor(
|
||||
media_addon_id addon,
|
||||
int32 flavor,
|
||||
media_node_id * out_id,
|
||||
int32 * io_count = 0); // default to 1
|
||||
|
||||
|
||||
status_t SetRealtimeFlags(
|
||||
uint32 in_enabled);
|
||||
status_t GetRealtimeFlags(
|
||||
uint32 * out_enabled);
|
||||
ssize_t AudioBufferSizeFor(
|
||||
int32 channel_count,
|
||||
uint32 sample_format,
|
||||
float frame_rate,
|
||||
bus_type bus_kind = B_UNKNOWN_BUS);
|
||||
|
||||
/* Use MediaFlags to inquire about specific features of the Media Kit. */
|
||||
/* Returns < 0 for "not present", positive size for output data size. */
|
||||
/* 0 means that the capability is present, but no data about it. */
|
||||
static ssize_t MediaFlags(
|
||||
media_flags cap,
|
||||
void * buf,
|
||||
size_t maxSize);
|
||||
|
||||
/* BLooper overrides */
|
||||
virtual void MessageReceived(
|
||||
BMessage * message);
|
||||
|
||||
virtual bool QuitRequested();
|
||||
|
||||
virtual BHandler * ResolveSpecifier(
|
||||
BMessage *msg,
|
||||
int32 index,
|
||||
BMessage *specifier,
|
||||
int32 form,
|
||||
const char *property);
|
||||
virtual status_t GetSupportedSuites(
|
||||
BMessage *data);
|
||||
|
||||
~BMediaRoster();
|
||||
|
||||
private:
|
||||
|
||||
// deprecated call
|
||||
status_t SetOutputBuffersFor(
|
||||
const media_source & output,
|
||||
BBufferGroup * group,
|
||||
bool will_reclaim = false);
|
||||
|
||||
/* FBC stuffing (Mmmh, Stuffing!) */
|
||||
virtual status_t _Reserved_MediaRoster_0(void *);
|
||||
virtual status_t _Reserved_MediaRoster_1(void *);
|
||||
virtual status_t _Reserved_MediaRoster_2(void *);
|
||||
virtual status_t _Reserved_MediaRoster_3(void *);
|
||||
virtual status_t _Reserved_MediaRoster_4(void *);
|
||||
virtual status_t _Reserved_MediaRoster_5(void *);
|
||||
virtual status_t _Reserved_MediaRoster_6(void *);
|
||||
virtual status_t _Reserved_MediaRoster_7(void *);
|
||||
|
||||
friend class BPrivate::media::DefaultDeleter;
|
||||
friend class BPrivate::media::BMediaRosterEx;
|
||||
|
||||
static bool _isMediaServer;
|
||||
|
||||
BMediaRoster();
|
||||
|
||||
static port_id _mReplyPort;
|
||||
static int32 _mReplyPortRes;
|
||||
static int32 _mReplyPortUnavailCount;
|
||||
|
||||
uint32 _reserved_media_roster_[67];
|
||||
|
||||
|
||||
static BMediaRoster * _sDefault;
|
||||
|
||||
static status_t ParseCommand(
|
||||
BMessage & reply);
|
||||
|
||||
status_t GetDefaultInfo(
|
||||
media_node_id for_default,
|
||||
BMessage & out_config);
|
||||
status_t SetRunningDefault(
|
||||
media_node_id for_default,
|
||||
const media_node & node);
|
||||
|
||||
static port_id checkout_reply_port(
|
||||
const char * name = NULL);
|
||||
static void checkin_reply_port(
|
||||
port_id port);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* _MEDIA_ROSTER_H */
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: ControlTheme.h
|
||||
/
|
||||
/ Description: A BMediaTheme is something which can live in an add-on and is
|
||||
/ responsible for creating BViews or BControls from a BParameterWeb and its
|
||||
/ set of BMControls. This way, different "looks" for Media Kit control panels
|
||||
/ can be achieved.
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_CONTROL_THEME_H)
|
||||
#define _CONTROL_THEME_H
|
||||
|
||||
|
||||
#include <Entry.h>
|
||||
#include <MediaDefs.h>
|
||||
|
||||
class BParameterWeb;
|
||||
|
||||
|
||||
class BMediaTheme
|
||||
{
|
||||
public:
|
||||
virtual ~BMediaTheme();
|
||||
|
||||
const char * Name();
|
||||
const char * Info();
|
||||
int32 ID();
|
||||
bool GetRef(
|
||||
entry_ref * out_ref);
|
||||
|
||||
static BView * ViewFor(
|
||||
BParameterWeb * web,
|
||||
const BRect * hintRect = NULL,
|
||||
BMediaTheme * using_theme = NULL);
|
||||
|
||||
/* This function takes possession of default_theme, even it if returns error */
|
||||
static status_t SetPreferredTheme(
|
||||
BMediaTheme * default_theme = NULL);
|
||||
|
||||
static BMediaTheme * PreferredTheme();
|
||||
|
||||
virtual BControl * MakeControlFor(
|
||||
BParameter * control) = 0;
|
||||
|
||||
enum bg_kind {
|
||||
B_GENERAL_BG = 0,
|
||||
B_SETTINGS_BG,
|
||||
B_PRESENTATION_BG,
|
||||
B_EDIT_BG,
|
||||
B_CONTROL_BG,
|
||||
B_HILITE_BG
|
||||
};
|
||||
enum fg_kind {
|
||||
B_GENERAL_FG = 0,
|
||||
B_SETTINGS_FG,
|
||||
B_PRESENTATION_FG,
|
||||
B_EDIT_FG,
|
||||
B_CONTROL_FG,
|
||||
B_HILITE_FG
|
||||
};
|
||||
|
||||
virtual BBitmap * BackgroundBitmapFor(
|
||||
bg_kind bg = B_GENERAL_BG);
|
||||
virtual rgb_color BackgroundColorFor(
|
||||
bg_kind bg = B_GENERAL_BG);
|
||||
virtual rgb_color ForegroundColorFor(
|
||||
fg_kind fg = B_GENERAL_FG);
|
||||
|
||||
protected:
|
||||
BMediaTheme(
|
||||
const char * name,
|
||||
const char * info,
|
||||
const entry_ref * add_on = 0,
|
||||
int32 theme_id = 0);
|
||||
|
||||
virtual BView * MakeViewFor(
|
||||
BParameterWeb * web,
|
||||
const BRect * hintRect = NULL) = 0;
|
||||
|
||||
static BControl * MakeFallbackViewFor(
|
||||
BParameter * control);
|
||||
|
||||
private:
|
||||
|
||||
BMediaTheme(); /* private unimplemented */
|
||||
BMediaTheme(
|
||||
const BMediaTheme & clone);
|
||||
BMediaTheme & operator=(
|
||||
const BMediaTheme & clone);
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_ControlTheme_0(void *);
|
||||
virtual status_t _Reserved_ControlTheme_1(void *);
|
||||
virtual status_t _Reserved_ControlTheme_2(void *);
|
||||
virtual status_t _Reserved_ControlTheme_3(void *);
|
||||
virtual status_t _Reserved_ControlTheme_4(void *);
|
||||
virtual status_t _Reserved_ControlTheme_5(void *);
|
||||
virtual status_t _Reserved_ControlTheme_6(void *);
|
||||
virtual status_t _Reserved_ControlTheme_7(void *);
|
||||
|
||||
char * _mName;
|
||||
char * _mInfo;
|
||||
int32 _mID;
|
||||
bool _mAddOn;
|
||||
entry_ref _mAddOnRef;
|
||||
uint32 _reserved_control_theme_[8];
|
||||
|
||||
static BMediaTheme * _mDefaultTheme;
|
||||
|
||||
};
|
||||
|
||||
/* Theme add-ons should export the functions: */
|
||||
#if defined(_BUILDING_THEME_ADDON)
|
||||
extern "C" _EXPORT BMediaTheme * make_theme(int32 id, image_id you);
|
||||
extern "C" _EXPORT status_t get_theme_at(int32 n, const char ** out_name, const char ** out_info, int32 * out_id);
|
||||
#endif /* _BUILDING_THEME_ADDON */
|
||||
|
||||
#endif /* _CONTROL_THEME_H */
|
||||
@@ -1,300 +0,0 @@
|
||||
#ifndef _MEDIA_TRACK_H
|
||||
#define _MEDIA_TRACK_H
|
||||
|
||||
#include <SupportDefs.h>
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaFormats.h>
|
||||
|
||||
namespace BPrivate {
|
||||
class MediaWriter;
|
||||
namespace media {
|
||||
class MediaExtractor;
|
||||
class Decoder;
|
||||
class Encoder;
|
||||
}
|
||||
}
|
||||
|
||||
class BView;
|
||||
class BParameterWeb;
|
||||
|
||||
enum media_seek_type {
|
||||
B_MEDIA_SEEK_CLOSEST_FORWARD = 1,
|
||||
B_MEDIA_SEEK_CLOSEST_BACKWARD = 2,
|
||||
B_MEDIA_SEEK_DIRECTION_MASK = 3
|
||||
};
|
||||
|
||||
//
|
||||
// BMediaTrack gives access to a particular media track in a media file
|
||||
// (as represented by BMediaFile).
|
||||
//
|
||||
// You always instantiate a BMediaTrack through BMediaFile::TrackAt()
|
||||
// or BMediaFile::CreateTrack(). When a BMediaTrack object is
|
||||
// constructed it finds the necessary decoder or encoder for the type
|
||||
// of data stored in the track.
|
||||
//
|
||||
// Unless you created the BMediaFile() in B_MEDIA_REPLACE_MODE, you
|
||||
// can only access a track for reading or writing, not both.
|
||||
//
|
||||
// If InitCheck() indicates no errors, then the track is ready to be
|
||||
// used to read and write frames using ReadFrames() and WriteFrames().
|
||||
// For video data you should always only read one frame.
|
||||
//
|
||||
// You can seek a track with SeekToTime() and SeekToFrame().
|
||||
//
|
||||
// If no codec could be found for the track, it is still possible to
|
||||
// access the encoded data using ReadChunk().
|
||||
//
|
||||
class BMediaTrack {
|
||||
|
||||
protected:
|
||||
|
||||
// Use BMediaFile::ReleaseTrack() instead -- or it will go away
|
||||
// on its own when the MediaFile is deleted.
|
||||
//
|
||||
virtual ~BMediaTrack();
|
||||
|
||||
public:
|
||||
|
||||
// for read-only access the BMediaTrack should be instantiated
|
||||
// through BMediaFile::TrackAt()
|
||||
|
||||
// for write-only access the BMediaTrack should be instantiated
|
||||
// through BMediaFile::CreateTrack()
|
||||
|
||||
status_t InitCheck() const;
|
||||
|
||||
// Get information about the codec being used.
|
||||
status_t GetCodecInfo(media_codec_info *mci) const;
|
||||
|
||||
|
||||
// EncodedFormat returns information about the track's
|
||||
// "native" encoded format.
|
||||
|
||||
status_t EncodedFormat(media_format *out_format) const;
|
||||
|
||||
// DecodedFormat is used to negotiate the format that the codec will
|
||||
// use when decoding the track's data. You pass in the format that
|
||||
// that you want; the codec will find and return its "best fit"
|
||||
// format. (inout_format is used as both the input and the returned
|
||||
// format.) The format is typically of the B_MEDIA_RAW_AUDIO or
|
||||
// B_MEDIA_RAW_VIDEO flavor.
|
||||
// The data returned through ReadFrames() will be in the format that's
|
||||
// returned by this function.
|
||||
|
||||
status_t DecodedFormat(media_format *inout_format, uint32 flags = 0);
|
||||
|
||||
// CountFrames and Duration return the total number of frame and the
|
||||
// total duration (expressed in microseconds) of a track.
|
||||
|
||||
int64 CountFrames() const;
|
||||
bigtime_t Duration() const;
|
||||
|
||||
// CurrentFrame and CurrentTime return the current position (expressed in
|
||||
// microseconds) within the track, expressed in frame index and time.
|
||||
|
||||
int64 CurrentFrame() const;
|
||||
bigtime_t CurrentTime() const;
|
||||
|
||||
// ReadFrames() fills a buffer with the next frames/samples. For a video
|
||||
// track, it decodes the next frame of video in the passed buffer. For
|
||||
// an audio track, it fills the buffers with the next N samples, as
|
||||
// negotiated by DecodedFormat(). However, if it reaches the end of the
|
||||
// file and was not able to fill the whole buffer, it returns a partial
|
||||
// buffer. Upon return, out_frameCount contains the actual number of
|
||||
// frame/samples returned, and the start time for the frame, expressed
|
||||
// in microseconds, is in the media_header structure.
|
||||
|
||||
status_t ReadFrames(void *out_buffer, int64 *out_frameCount,
|
||||
media_header *mh = NULL);
|
||||
|
||||
status_t ReadFrames(void *out_buffer, int64 *out_frameCount,
|
||||
media_header *mh, media_decode_info *info);
|
||||
|
||||
status_t ReplaceFrames(const void *in_buffer, int64 *io_frameCount,
|
||||
const media_header *mh);
|
||||
|
||||
|
||||
// SeekToTime and SeekToFrame are used for seeking to a particular
|
||||
// position in a track, expressed in either frames or microseconds.
|
||||
// They return whatever position they were able to seek to. For example,
|
||||
// a video codec may not be able to seek to arbitrary frames, but only to
|
||||
// key frames. In this case, it would return the closest key frame before
|
||||
// the specified seek point.
|
||||
//
|
||||
// If you want to explicitly seek to the nearest keyframe _before_ this
|
||||
// frame or _after_ this frame, pass B_MEDIA_SEEK_CLOSEST_FORWARD or
|
||||
// B_MEDIA_SEEK_CLOSEST_BACKWARD as the flags field.
|
||||
//
|
||||
|
||||
status_t SeekToTime(bigtime_t *inout_time, int32 flags=0);
|
||||
status_t SeekToFrame(int64 *inout_frame, int32 flags=0);
|
||||
|
||||
status_t FindKeyFrameForTime(bigtime_t *inout_time, int32 flags=0) const;
|
||||
status_t FindKeyFrameForFrame(int64 *inout_frame, int32 flags=0) const;
|
||||
|
||||
// ReadChunk returns, in out_buffer, the next out_size bytes of
|
||||
// data from the track. The data is not decoded -- it will be
|
||||
// in its native encoded format (as specified by EncodedFormat()).
|
||||
// You can not mix calling ReadChunk() and ReadFrames() -- either
|
||||
// you access the track raw (i.e. with ReadChunk) or you access
|
||||
// it with ReadFrames.
|
||||
|
||||
status_t ReadChunk(char **out_buffer, int32 *out_size,
|
||||
media_header *mh = NULL);
|
||||
|
||||
|
||||
//
|
||||
// Write-only Functions
|
||||
//
|
||||
status_t AddCopyright(const char *data);
|
||||
status_t AddTrackInfo(uint32 code, const void *data, size_t size,
|
||||
uint32 flags = 0);
|
||||
|
||||
//
|
||||
// Write num_frames of data to the track. This data is passed
|
||||
// through the encoder that was specified when the MediaTrack
|
||||
// was constructed.
|
||||
// Pass B_MEDIA_KEY_FRAME for flags if it is.
|
||||
//
|
||||
status_t WriteFrames(const void *data, int32 num_frames,
|
||||
int32 flags = 0);
|
||||
status_t WriteFrames(const void *data, int64 num_frames,
|
||||
media_encode_info *info);
|
||||
|
||||
//
|
||||
// Write a raw chunk of (presumably already encoded data) to
|
||||
// the file.
|
||||
// Pass B_MEDIA_KEY_FRAME for flags if it is.
|
||||
//
|
||||
status_t WriteChunk(const void *data, size_t size,
|
||||
uint32 flags = 0);
|
||||
status_t WriteChunk(const void *data, size_t size,
|
||||
media_encode_info *info);
|
||||
|
||||
// Flush all buffered encoded datas to disk. You should call it after
|
||||
// writing the last frame to be sure all datas are flushed at the right
|
||||
// offset into the file.
|
||||
status_t Flush();
|
||||
|
||||
// These are for controlling the underlying encoder and track parameters
|
||||
// returns a copy of the parameter web
|
||||
status_t GetParameterWeb(BParameterWeb** outWeb);
|
||||
status_t GetParameterValue(int32 id, void *valu, size_t *size);
|
||||
status_t SetParameterValue(int32 id, const void *valu, size_t size);
|
||||
BView *GetParameterView();
|
||||
|
||||
// This is a simplified control API, only one parameter low=0.0, high=1.0
|
||||
// Return B_ERROR if it's not supported by the current encoder.
|
||||
status_t GetQuality(float *quality);
|
||||
status_t SetQuality(float quality);
|
||||
|
||||
status_t GetEncodeParameters(encode_parameters *parameters) const;
|
||||
status_t SetEncodeParameters(encode_parameters *parameters);
|
||||
|
||||
|
||||
virtual status_t Perform(int32 selector, void * data);
|
||||
|
||||
private:
|
||||
friend class BMediaFile;
|
||||
|
||||
// deprecated, but for BeOS R5 compatibility
|
||||
BParameterWeb *Web();
|
||||
|
||||
// Does nothing, returns B_ERROR, for Zeta compatiblity only
|
||||
status_t ControlCodec(int32 selector, void *io_data, size_t size);
|
||||
|
||||
// for read-only access to a track
|
||||
BMediaTrack(BPrivate::media::MediaExtractor *extractor, int32 stream);
|
||||
|
||||
// for write-only access to a BMediaTrack
|
||||
BMediaTrack(BPrivate::MediaWriter *writer,
|
||||
int32 stream_num,
|
||||
media_format *in_format,
|
||||
BPrivate::media::Encoder *encoder,
|
||||
media_codec_info *mci);
|
||||
|
||||
void SetupWorkaround();
|
||||
bool SetupFormatTranslation(const media_format &from, media_format *to);
|
||||
|
||||
status_t fErr;
|
||||
BPrivate::media::Decoder *fDecoder;
|
||||
BPrivate::media::Decoder *fRawDecoder;
|
||||
BPrivate::media::MediaExtractor *fExtractor;
|
||||
|
||||
int32 fStream;
|
||||
int64 fCurFrame;
|
||||
bigtime_t fCurTime;
|
||||
|
||||
media_codec_info fMCI;
|
||||
|
||||
BPrivate::media::Encoder *fEncoder;
|
||||
int32 fEncoderID;
|
||||
BPrivate::MediaWriter *fWriter;
|
||||
media_format fWriterFormat;
|
||||
|
||||
uint32 fWorkaroundFlags;
|
||||
|
||||
protected:
|
||||
int32 EncoderID() { return fEncoderID; };
|
||||
|
||||
private:
|
||||
|
||||
BMediaTrack();
|
||||
BMediaTrack(const BMediaTrack&);
|
||||
BMediaTrack& operator=(const BMediaTrack&);
|
||||
|
||||
/* fbc data and virtuals */
|
||||
|
||||
uint32 _reserved_BMediaTrack_[31];
|
||||
|
||||
virtual status_t _Reserved_BMediaTrack_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_23(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_24(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_25(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_26(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_27(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_28(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_29(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_30(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_31(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_32(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_33(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_34(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_35(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_36(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_37(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_38(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_39(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_40(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_41(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_42(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_43(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_44(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_45(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_46(int32 arg, ...);
|
||||
virtual status_t _Reserved_BMediaTrack_47(int32 arg, ...);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,523 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: ParameterWeb.h
|
||||
/
|
||||
/ Description: A BParameterWeb is a description of media controls within a BControllable
|
||||
/ Media Kit Node.
|
||||
/ BParameter, BParameterGroup, BContinuousParameter, BDiscreteParameter and
|
||||
/ BNullParameter are "data classes" used to describe the relation within a
|
||||
/ BParameterWeb. These are NOT direct visible classes like BControls; just data
|
||||
/ containers which applications can use to decide what kind of views to create.
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_CONTROL_WEB_H)
|
||||
#define _CONTROL_WEB_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <Flattenable.h>
|
||||
#include <MediaNode.h>
|
||||
|
||||
#if !defined(_PR3_COMPATIBLE_)
|
||||
enum {
|
||||
B_MEDIA_PARAMETER_TYPE = 'BMCT',
|
||||
B_MEDIA_PARAMETER_WEB_TYPE = 'BMCW',
|
||||
B_MEDIA_PARAMETER_GROUP_TYPE= 'BMCG'
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
// It is highly unfortunate that a linker bug forces these symbols out
|
||||
// from the BParameter class. Hope they don't collide with anything else.
|
||||
|
||||
/* These are control KINDs */
|
||||
/* kind used when you don't know or care */
|
||||
extern _IMPEXP_MEDIA const char * const B_GENERIC;
|
||||
/* kinds used for sliders */
|
||||
extern _IMPEXP_MEDIA const char * const B_MASTER_GAIN; /* Main Volume */
|
||||
extern _IMPEXP_MEDIA const char * const B_GAIN;
|
||||
extern _IMPEXP_MEDIA const char * const B_BALANCE;
|
||||
extern _IMPEXP_MEDIA const char * const B_FREQUENCY; /* like a radio tuner */
|
||||
extern _IMPEXP_MEDIA const char * const B_LEVEL; /* like for effects */
|
||||
extern _IMPEXP_MEDIA const char * const B_SHUTTLE_SPEED; /* Play, SloMo, Scan 1.0 == regular */
|
||||
extern _IMPEXP_MEDIA const char * const B_CROSSFADE; /* 0 == first input, +100 == second input */
|
||||
extern _IMPEXP_MEDIA const char * const B_EQUALIZATION; /* depth (dB) */
|
||||
|
||||
/* kinds used for compressors */
|
||||
extern _IMPEXP_MEDIA const char * const B_COMPRESSION; /* 0% == no compression, 99% == 100:1 compression */
|
||||
extern _IMPEXP_MEDIA const char * const B_QUALITY; /* 0% == full compression, 100% == no compression */
|
||||
extern _IMPEXP_MEDIA const char * const B_BITRATE; /* in bits/second */
|
||||
extern _IMPEXP_MEDIA const char * const B_GOP_SIZE; /* Group Of Pictures. a k a "Keyframe every N frames" */
|
||||
/* kinds used for selectors */
|
||||
extern _IMPEXP_MEDIA const char * const B_MUTE; /* 0 == thru, 1 == mute */
|
||||
extern _IMPEXP_MEDIA const char * const B_ENABLE; /* 0 == disable, 1 == enable */
|
||||
extern _IMPEXP_MEDIA const char * const B_INPUT_MUX; /* "value" 1-N == input selected */
|
||||
extern _IMPEXP_MEDIA const char * const B_OUTPUT_MUX; /* "value" 1-N == output selected */
|
||||
extern _IMPEXP_MEDIA const char * const B_TUNER_CHANNEL; /* like cable TV */
|
||||
extern _IMPEXP_MEDIA const char * const B_TRACK; /* like a CD player; "value" should be 1-N */
|
||||
extern _IMPEXP_MEDIA const char * const B_RECSTATE; /* like mutitrack tape deck, 0 == silent, 1 == play, 2 == record */
|
||||
extern _IMPEXP_MEDIA const char * const B_SHUTTLE_MODE; /* -1 == backwards, 0 == stop, 1 == play, 2 == pause/cue */
|
||||
extern _IMPEXP_MEDIA const char * const B_RESOLUTION;
|
||||
extern _IMPEXP_MEDIA const char * const B_COLOR_SPACE; /* "value" should be color_space */
|
||||
extern _IMPEXP_MEDIA const char * const B_FRAME_RATE;
|
||||
extern _IMPEXP_MEDIA const char * const B_VIDEO_FORMAT; /* 1 == NTSC-M, 2 == NTSC-J, 3 == PAL-BDGHI, 4 == PAL-M, 5 == PAL-N, 6 == SECAM, 7 == MPEG-1, 8 == MPEG-2 */
|
||||
/* kinds used for junctions */
|
||||
// the prefix of "WEB" is to avoid collission with an enum in Defs.h
|
||||
extern _IMPEXP_MEDIA const char * const B_WEB_PHYSICAL_INPUT; /* a jack on the back of the card */
|
||||
extern _IMPEXP_MEDIA const char * const B_WEB_PHYSICAL_OUTPUT;
|
||||
extern _IMPEXP_MEDIA const char * const B_WEB_ADC_CONVERTER; /* from analog to digital signals */
|
||||
extern _IMPEXP_MEDIA const char * const B_WEB_DAC_CONVERTER; /* from digital to analog signals */
|
||||
extern _IMPEXP_MEDIA const char * const B_WEB_LOGICAL_INPUT; /* an "input" that may not be physical */
|
||||
extern _IMPEXP_MEDIA const char * const B_WEB_LOGICAL_OUTPUT;
|
||||
extern _IMPEXP_MEDIA const char * const B_WEB_LOGICAL_BUS; /* a logical connection point that is neither input nor output; auxilliary bus */
|
||||
extern _IMPEXP_MEDIA const char * const B_WEB_BUFFER_INPUT; /* an input that corresponds to a media_input */
|
||||
extern _IMPEXP_MEDIA const char * const B_WEB_BUFFER_OUTPUT;
|
||||
|
||||
// a simple transport control is a discrete parameter with five values (states):
|
||||
// rewinding, stopped, playing, paused, and fast-forwarding
|
||||
extern _IMPEXP_MEDIA const char * const B_SIMPLE_TRANSPORT;
|
||||
|
||||
class BList;
|
||||
class BParameterGroup;
|
||||
class BParameter;
|
||||
class BNullParameter;
|
||||
class BContinuousParameter;
|
||||
class BDiscreteParameter;
|
||||
|
||||
|
||||
/* Set these flags on parameters and groups to control how a Theme will */
|
||||
/* render the Web. Hidden means, generally, "don't show". Advanced means, */
|
||||
/* generally, that you can show it or not depending on your whim. */
|
||||
enum media_parameter_flags {
|
||||
B_HIDDEN_PARAMETER = 0x1,
|
||||
B_ADVANCED_PARAMETER = 0x2
|
||||
};
|
||||
|
||||
|
||||
class BParameterWeb :
|
||||
public BFlattenable
|
||||
{
|
||||
public:
|
||||
BParameterWeb();
|
||||
~BParameterWeb();
|
||||
|
||||
media_node Node();
|
||||
|
||||
BParameterGroup * MakeGroup(
|
||||
const char * name);
|
||||
|
||||
int32 CountGroups();
|
||||
BParameterGroup * GroupAt(
|
||||
int32 index);
|
||||
int32 CountParameters();
|
||||
BParameter * ParameterAt(
|
||||
int32 index);
|
||||
|
||||
virtual bool IsFixedSize() const;
|
||||
virtual type_code TypeCode() const;
|
||||
virtual ssize_t FlattenedSize() const;
|
||||
virtual status_t Flatten(void *buffer, ssize_t size) const;
|
||||
virtual bool AllowsTypeCode(type_code code) const;
|
||||
virtual status_t Unflatten(type_code c, const void *buf, ssize_t size);
|
||||
|
||||
private:
|
||||
|
||||
friend class BParameterGroup;
|
||||
friend class BControllable;
|
||||
|
||||
BParameterWeb(
|
||||
const BParameterWeb & clone);
|
||||
BParameterWeb & operator=(
|
||||
const BParameterWeb & clone);
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_ControlWeb_0(void *);
|
||||
virtual status_t _Reserved_ControlWeb_1(void *);
|
||||
virtual status_t _Reserved_ControlWeb_2(void *);
|
||||
virtual status_t _Reserved_ControlWeb_3(void *);
|
||||
virtual status_t _Reserved_ControlWeb_4(void *);
|
||||
virtual status_t _Reserved_ControlWeb_5(void *);
|
||||
virtual status_t _Reserved_ControlWeb_6(void *);
|
||||
virtual status_t _Reserved_ControlWeb_7(void *);
|
||||
|
||||
BList * mGroups;
|
||||
media_node mNode;
|
||||
uint32 _reserved_control_web_[8];
|
||||
|
||||
BList * mOldRefs;
|
||||
BList * mNewRefs;
|
||||
|
||||
void AddRefFix(
|
||||
void * oldItem,
|
||||
void * newItem);
|
||||
};
|
||||
|
||||
|
||||
class BParameterGroup :
|
||||
public BFlattenable
|
||||
{
|
||||
private:
|
||||
|
||||
BParameterGroup(
|
||||
BParameterWeb * web,
|
||||
const char * name);
|
||||
virtual ~BParameterGroup();
|
||||
|
||||
public:
|
||||
|
||||
BParameterWeb * Web() const;
|
||||
const char * Name() const;
|
||||
|
||||
void SetFlags(uint32 flags);
|
||||
uint32 Flags() const;
|
||||
|
||||
BNullParameter * MakeNullParameter(
|
||||
int32 id,
|
||||
media_type m_type,
|
||||
const char * name,
|
||||
const char * kind);
|
||||
BContinuousParameter * MakeContinuousParameter(
|
||||
int32 id,
|
||||
media_type m_type,
|
||||
const char * name,
|
||||
const char * kind,
|
||||
const char * unit,
|
||||
float minimum,
|
||||
float maximum,
|
||||
float stepping);
|
||||
BDiscreteParameter * MakeDiscreteParameter(
|
||||
int32 id,
|
||||
media_type m_type,
|
||||
const char * name,
|
||||
const char * kind);
|
||||
BParameterGroup * MakeGroup(
|
||||
const char * name);
|
||||
|
||||
int32 CountParameters();
|
||||
BParameter * ParameterAt(
|
||||
int32 index);
|
||||
int32 CountGroups();
|
||||
BParameterGroup * GroupAt(
|
||||
int32 index);
|
||||
|
||||
virtual bool IsFixedSize() const;
|
||||
virtual type_code TypeCode() const;
|
||||
virtual ssize_t FlattenedSize() const;
|
||||
virtual status_t Flatten(void *buffer, ssize_t size) const;
|
||||
virtual bool AllowsTypeCode(type_code code) const;
|
||||
virtual status_t Unflatten(type_code c, const void *buf, ssize_t size);
|
||||
|
||||
private:
|
||||
|
||||
BParameterGroup(); /* private unimplemented */
|
||||
BParameterGroup(
|
||||
const BParameterGroup & clone);
|
||||
BParameterGroup & operator=(
|
||||
const BParameterGroup & clone);
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_ControlGroup_0(void *);
|
||||
virtual status_t _Reserved_ControlGroup_1(void *);
|
||||
virtual status_t _Reserved_ControlGroup_2(void *);
|
||||
virtual status_t _Reserved_ControlGroup_3(void *);
|
||||
virtual status_t _Reserved_ControlGroup_4(void *);
|
||||
virtual status_t _Reserved_ControlGroup_5(void *);
|
||||
virtual status_t _Reserved_ControlGroup_6(void *);
|
||||
virtual status_t _Reserved_ControlGroup_7(void *);
|
||||
|
||||
friend class BParameterWeb;
|
||||
|
||||
BParameterWeb * mWeb;
|
||||
BList * mControls;
|
||||
BList * mGroups;
|
||||
char * mName;
|
||||
uint32 mFlags;
|
||||
uint32 _reserved_control_group_[7];
|
||||
|
||||
BParameter * MakeControl(
|
||||
int32 type);
|
||||
};
|
||||
|
||||
|
||||
/* After you create a BParameter, hook it up by calling AddInput() and/or AddOutput() */
|
||||
/* (which will call the reciprocal in the target) and optionally call SetChannelCount() and SetMediaType() */
|
||||
class BParameter :
|
||||
public BFlattenable
|
||||
{
|
||||
public:
|
||||
|
||||
/* This is a parameter TYPE */
|
||||
enum media_parameter_type
|
||||
{
|
||||
B_NULL_PARAMETER,
|
||||
B_DISCRETE_PARAMETER,
|
||||
B_CONTINUOUS_PARAMETER
|
||||
};
|
||||
|
||||
media_parameter_type Type() const;
|
||||
BParameterWeb * Web() const;
|
||||
BParameterGroup * Group() const;
|
||||
const char * Name() const;
|
||||
const char * Kind() const;
|
||||
const char * Unit() const;
|
||||
int32 ID() const;
|
||||
|
||||
void SetFlags(uint32 flags);
|
||||
uint32 Flags() const;
|
||||
|
||||
virtual type_code ValueType() = 0;
|
||||
/* These functions are typically used by client apps; they will result in */
|
||||
/* your BControllable getting called to read/write values. */
|
||||
status_t GetValue(
|
||||
void * buffer,
|
||||
size_t * ioSize,
|
||||
bigtime_t * when);
|
||||
status_t SetValue(
|
||||
const void * buffer,
|
||||
size_t size,
|
||||
bigtime_t when);
|
||||
int32 CountChannels(); /* Number of ValueType() values; default is 1 */
|
||||
void SetChannelCount( /* One value could still control e g a stereo pair */
|
||||
int32 channel_count);
|
||||
|
||||
media_type MediaType(); /* Optional (default is B_MEDIA_NO_TYPE) */
|
||||
void SetMediaType(media_type m_type);
|
||||
|
||||
int32 CountInputs();
|
||||
BParameter * InputAt(
|
||||
int32 index);
|
||||
void AddInput(
|
||||
BParameter * input);
|
||||
int32 CountOutputs();
|
||||
BParameter * OutputAt(
|
||||
int32 index);
|
||||
void AddOutput(
|
||||
BParameter * output);
|
||||
|
||||
virtual bool IsFixedSize() const;
|
||||
virtual type_code TypeCode() const;
|
||||
virtual ssize_t FlattenedSize() const;
|
||||
virtual status_t Flatten(void *buffer, ssize_t size) const;
|
||||
virtual bool AllowsTypeCode(type_code code) const;
|
||||
virtual status_t Unflatten(type_code c, const void *buf, ssize_t size);
|
||||
|
||||
private:
|
||||
friend class BNullParameter;
|
||||
friend class BContinuousParameter;
|
||||
friend class BDiscreteParameter;
|
||||
friend class BParameterGroup;
|
||||
friend class BParameterWeb;
|
||||
|
||||
bool SwapOnUnflatten() { return mSwapDetected; }
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_Control_0(void *);
|
||||
virtual status_t _Reserved_Control_1(void *);
|
||||
virtual status_t _Reserved_Control_2(void *);
|
||||
virtual status_t _Reserved_Control_3(void *);
|
||||
virtual status_t _Reserved_Control_4(void *);
|
||||
virtual status_t _Reserved_Control_5(void *);
|
||||
virtual status_t _Reserved_Control_6(void *);
|
||||
virtual status_t _Reserved_Control_7(void *);
|
||||
|
||||
|
||||
BParameter(
|
||||
int32 id,
|
||||
media_type m_type,
|
||||
media_parameter_type type,
|
||||
BParameterWeb * web,
|
||||
const char * name,
|
||||
const char * kind,
|
||||
const char * unit);
|
||||
~BParameter();
|
||||
|
||||
int32 mID;
|
||||
media_parameter_type mType;
|
||||
BParameterWeb * mWeb;
|
||||
BParameterGroup * mGroup;
|
||||
char * mName;
|
||||
char * mKind;
|
||||
char * mUnit;
|
||||
BList * mInputs;
|
||||
BList * mOutputs;
|
||||
bool mSwapDetected;
|
||||
media_type mMediaType;
|
||||
int32 mChannels;
|
||||
uint32 mFlags;
|
||||
uint32 _reserved_control_[7];
|
||||
|
||||
virtual void FixRefs(
|
||||
BList & old,
|
||||
BList & updated);
|
||||
};
|
||||
|
||||
|
||||
class BContinuousParameter :
|
||||
public BParameter
|
||||
{
|
||||
public:
|
||||
|
||||
virtual type_code ValueType();
|
||||
|
||||
float MinValue();
|
||||
float MaxValue();
|
||||
float ValueStep();
|
||||
|
||||
/* The "response" specifies what value to display to the user. */
|
||||
/* Thus, if response is B_POLYNOMIAL with factor 2, an actual */
|
||||
/* control value of 10 would be displayed to the user as 100, and */
|
||||
/* if response was B_EXPONENTIAL and factor was 2, an actual */
|
||||
/* value of 3 would display 8 (two to the third). The ValueStep() */
|
||||
/* is given in actual control values, before the transformation for */
|
||||
/* display is done. Thus, with min 0, max 4 and value step 1, and an */
|
||||
/* exponential response with factor 10, you will get the displayed */
|
||||
/* values 1, 10, 100, 1000 and 10000 equally spaced across a slider */
|
||||
/* (or whatever UI the app puts to the parameter). */
|
||||
/* The "offset" is added to the value after transformation, before display. */
|
||||
/* If "resp" is negative, the resulting value/display relation is turned upside down. */
|
||||
enum response {
|
||||
B_UNKNOWN = 0,
|
||||
B_LINEAR = 1, /* factor is direct multiplier >= 0 */
|
||||
B_POLYNOMIAL, /* factor should be power; typically "2" for squared or "-1" for inverse */
|
||||
B_EXPONENTIAL, /* factor should be base, typically 2 or 10 */
|
||||
B_LOGARITHMIC /* factor should be base, typically 2 or 10 */
|
||||
};
|
||||
void SetResponse(
|
||||
int resp,
|
||||
float factor,
|
||||
float offset);
|
||||
void GetResponse(
|
||||
int * resp,
|
||||
float * factor,
|
||||
float * offset);
|
||||
|
||||
virtual ssize_t FlattenedSize() const;
|
||||
virtual status_t Flatten(void *buffer, ssize_t size) const;
|
||||
virtual status_t Unflatten(type_code c, const void *buf, ssize_t size);
|
||||
|
||||
private:
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_ContinuousParameter_0(void *);
|
||||
virtual status_t _Reserved_ContinuousParameter_1(void *);
|
||||
virtual status_t _Reserved_ContinuousParameter_2(void *);
|
||||
virtual status_t _Reserved_ContinuousParameter_3(void *);
|
||||
virtual status_t _Reserved_ContinuousParameter_4(void *);
|
||||
virtual status_t _Reserved_ContinuousParameter_5(void *);
|
||||
virtual status_t _Reserved_ContinuousParameter_6(void *);
|
||||
virtual status_t _Reserved_ContinuousParameter_7(void *);
|
||||
friend class BParameterGroup;
|
||||
|
||||
BContinuousParameter(
|
||||
int32 id,
|
||||
media_type m_type,
|
||||
BParameterWeb * web,
|
||||
const char * name,
|
||||
const char * kind,
|
||||
const char * unit,
|
||||
float minimum,
|
||||
float maximum,
|
||||
float stepping);
|
||||
~BContinuousParameter();
|
||||
|
||||
float mMinimum;
|
||||
float mMaximum;
|
||||
float mStepping;
|
||||
response mResponse;
|
||||
float mFactor;
|
||||
float mOffset;
|
||||
uint32 _reserved_control_slider_[8];
|
||||
|
||||
};
|
||||
|
||||
|
||||
class BDiscreteParameter :
|
||||
public BParameter
|
||||
{
|
||||
public:
|
||||
|
||||
virtual type_code ValueType();
|
||||
|
||||
int32 CountItems();
|
||||
const char * ItemNameAt(
|
||||
int32 index);
|
||||
int32 ItemValueAt(
|
||||
int32 index);
|
||||
status_t AddItem(
|
||||
int32 value,
|
||||
const char * name);
|
||||
status_t MakeItemsFromInputs();
|
||||
status_t MakeItemsFromOutputs();
|
||||
void MakeEmpty();
|
||||
|
||||
virtual ssize_t FlattenedSize() const;
|
||||
virtual status_t Flatten(void *buffer, ssize_t size) const;
|
||||
virtual status_t Unflatten(type_code c, const void *buf, ssize_t size);
|
||||
|
||||
private:
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_DiscreteParameter_0(void *);
|
||||
virtual status_t _Reserved_DiscreteParameter_1(void *);
|
||||
virtual status_t _Reserved_DiscreteParameter_2(void *);
|
||||
virtual status_t _Reserved_DiscreteParameter_3(void *);
|
||||
virtual status_t _Reserved_DiscreteParameter_4(void *);
|
||||
virtual status_t _Reserved_DiscreteParameter_5(void *);
|
||||
virtual status_t _Reserved_DiscreteParameter_6(void *);
|
||||
virtual status_t _Reserved_DiscreteParameter_7(void *);
|
||||
|
||||
friend class BParameterGroup;
|
||||
|
||||
BList * mSelections;
|
||||
BList * mValues;
|
||||
uint32 _reserved_control_selector_[8];
|
||||
|
||||
BDiscreteParameter(
|
||||
int32 id,
|
||||
media_type m_type,
|
||||
BParameterWeb * web,
|
||||
const char * name,
|
||||
const char * kind);
|
||||
~BDiscreteParameter();
|
||||
};
|
||||
|
||||
|
||||
class BNullParameter :
|
||||
public BParameter
|
||||
{
|
||||
public:
|
||||
|
||||
virtual type_code ValueType();
|
||||
|
||||
virtual ssize_t FlattenedSize() const;
|
||||
virtual status_t Flatten(void *buffer, ssize_t size) const;
|
||||
virtual status_t Unflatten(type_code c, const void *buf, ssize_t size);
|
||||
|
||||
private:
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_NullParameter_0(void *);
|
||||
virtual status_t _Reserved_NullParameter_1(void *);
|
||||
virtual status_t _Reserved_NullParameter_2(void *);
|
||||
virtual status_t _Reserved_NullParameter_3(void *);
|
||||
virtual status_t _Reserved_NullParameter_4(void *);
|
||||
virtual status_t _Reserved_NullParameter_5(void *);
|
||||
virtual status_t _Reserved_NullParameter_6(void *);
|
||||
virtual status_t _Reserved_NullParameter_7(void *);
|
||||
|
||||
friend class BParameterGroup;
|
||||
|
||||
uint32 _reserved_control_junction_[8];
|
||||
|
||||
BNullParameter(
|
||||
int32 id,
|
||||
media_type m_type,
|
||||
BParameterWeb * web,
|
||||
const char * name,
|
||||
const char * kind);
|
||||
~BNullParameter();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* _CONTROL_WEB_H */
|
||||
@@ -1,34 +0,0 @@
|
||||
/******************************************************************************
|
||||
|
||||
File: PlaySound.h
|
||||
|
||||
Description: Interface for a simple beep sound.
|
||||
|
||||
Copyright 1995-97, Be Incorporated
|
||||
|
||||
******************************************************************************/
|
||||
#ifndef _PLAY_SOUND_H
|
||||
#define _PLAY_SOUND_H
|
||||
|
||||
#ifndef _BE_BUILD_H
|
||||
#include <BeBuild.h>
|
||||
#endif
|
||||
#include <OS.h>
|
||||
#include <Entry.h>
|
||||
|
||||
typedef sem_id sound_handle;
|
||||
|
||||
_IMPEXP_MEDIA
|
||||
sound_handle play_sound(const entry_ref *soundRef,
|
||||
bool mix,
|
||||
bool queue,
|
||||
bool background
|
||||
);
|
||||
|
||||
_IMPEXP_MEDIA
|
||||
status_t stop_sound(sound_handle handle);
|
||||
|
||||
_IMPEXP_MEDIA
|
||||
status_t wait_for_sound(sound_handle handle);
|
||||
|
||||
#endif /* #ifndef _PLAY_SOUND_H*/
|
||||
@@ -1,51 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: RealtimeAlloc.h
|
||||
/
|
||||
/ Description: Allocation from separate "pools" of memory. Those pools
|
||||
/ will be locked in RAM if realtime allocators are turned
|
||||
/ on in the BMediaRoster, so don't waste this memory unless
|
||||
/ it's needed. Also, the shared pool is a scarce resource,
|
||||
/ so it's better if you create your own pool for your own
|
||||
/ needs and leave the shared pool for BMediaNode instances
|
||||
/ and the needs of the Media Kit.
|
||||
/
|
||||
/ Copyright 1998-99, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_REALTIME_ALLOC_H)
|
||||
#define _REALTIME_ALLOC_H
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct rtm_pool rtm_pool;
|
||||
|
||||
/* If out_pool is NULL, the default pool will be created if it isn't already. */
|
||||
/* If the default pool is already created, it will return EALREADY. */
|
||||
#if defined(__cplusplus)
|
||||
_IMPEXP_MEDIA status_t rtm_create_pool(rtm_pool ** out_pool, size_t total_size, const char * name=NULL);
|
||||
#else
|
||||
_IMPEXP_MEDIA status_t rtm_create_pool(rtm_pool ** out_pool, size_t total_size, const char * name);
|
||||
#endif
|
||||
_IMPEXP_MEDIA status_t rtm_delete_pool(rtm_pool * pool);
|
||||
/* If NULL is passed for pool, the default pool is used (if created). */
|
||||
_IMPEXP_MEDIA void * rtm_alloc(rtm_pool * pool, size_t size);
|
||||
_IMPEXP_MEDIA status_t rtm_free(void * data);
|
||||
_IMPEXP_MEDIA status_t rtm_realloc(void ** data, size_t new_size);
|
||||
_IMPEXP_MEDIA status_t rtm_size_for(void * data);
|
||||
_IMPEXP_MEDIA status_t rtm_phys_size_for(void * data);
|
||||
|
||||
/* Return the default pool, or NULL if not yet initialized */
|
||||
_IMPEXP_MEDIA rtm_pool * rtm_default_pool();
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _REALTIME_ALLOC_H
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
/* BSound.h */
|
||||
/* Copyright 1998 Be Incorporated. All rights reserved. */
|
||||
|
||||
#if !defined(_SOUND_H)
|
||||
#define _SOUND_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
|
||||
class BSoundFile;
|
||||
|
||||
namespace BPrivate {
|
||||
class BTrackReader;
|
||||
}
|
||||
|
||||
class BSound {
|
||||
public:
|
||||
BSound(
|
||||
void * data,
|
||||
size_t size,
|
||||
const media_raw_audio_format & format,
|
||||
bool free_when_done = false);
|
||||
BSound(
|
||||
const entry_ref * sound_file,
|
||||
bool load_into_memory = false);
|
||||
|
||||
status_t InitCheck();
|
||||
BSound * AcquireRef();
|
||||
bool ReleaseRef();
|
||||
int32 RefCount() const; // unreliable!
|
||||
|
||||
virtual bigtime_t Duration() const;
|
||||
virtual const media_raw_audio_format & Format() const;
|
||||
virtual const void * Data() const; /* returns NULL for files */
|
||||
virtual off_t Size() const;
|
||||
|
||||
virtual bool GetDataAt(
|
||||
off_t offset,
|
||||
void * into_buffer,
|
||||
size_t buffer_size,
|
||||
size_t * out_used);
|
||||
|
||||
protected:
|
||||
|
||||
BSound(
|
||||
const media_raw_audio_format & format);
|
||||
|
||||
virtual status_t Perform(
|
||||
int32 code,
|
||||
...);
|
||||
|
||||
private:
|
||||
|
||||
BSound(const BSound &); // unimplemented
|
||||
BSound & operator=(const BSound &); // unimplemented
|
||||
|
||||
friend class BSoundPlayer;
|
||||
friend class _HostApp;
|
||||
|
||||
void Reset();
|
||||
|
||||
virtual ~BSound();
|
||||
|
||||
void free_data();
|
||||
static status_t load_entry(void * arg);
|
||||
void loader_thread();
|
||||
bool check_stop();
|
||||
|
||||
public:
|
||||
|
||||
virtual status_t BindTo(
|
||||
BSoundPlayer * player,
|
||||
const media_raw_audio_format & format);
|
||||
virtual status_t UnbindFrom(
|
||||
BSoundPlayer * player);
|
||||
|
||||
private:
|
||||
status_t _Reserved_Sound_0(void *); // BindTo
|
||||
status_t _Reserved_Sound_1(void *); // UnbindFrom
|
||||
virtual status_t _Reserved_Sound_2(void *);
|
||||
virtual status_t _Reserved_Sound_3(void *);
|
||||
virtual status_t _Reserved_Sound_4(void *);
|
||||
virtual status_t _Reserved_Sound_5(void *);
|
||||
|
||||
void * _m_data;
|
||||
BMediaFile * _m_file;
|
||||
int32 _m_ref_count;
|
||||
status_t _m_error;
|
||||
size_t _m_size;
|
||||
media_raw_audio_format _m_format;
|
||||
bool _m_free_when_done;
|
||||
bool _m_checkStopped;
|
||||
bool _m_reserved[2];
|
||||
area_id _m_area;
|
||||
sem_id _m_avail_sem;
|
||||
sem_id _m_free_sem;
|
||||
thread_id _m_loader_thread;
|
||||
size_t _m_read_pos;
|
||||
sem_id _m_check_token;
|
||||
int32 _m_prev_sem_count;
|
||||
|
||||
BSoundPlayer * _m_bound_player;
|
||||
int32 _m_bind_flags;
|
||||
|
||||
BPrivate::BTrackReader * _m_trackReader;
|
||||
char m_tname[32];
|
||||
uint32 _reserved_[1];
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* _SOUND_H */
|
||||
@@ -1,103 +0,0 @@
|
||||
/******************************************************************************
|
||||
|
||||
File: SoundFile.h
|
||||
|
||||
Description: Interface for a format-insensitive sound file object.
|
||||
|
||||
Copyright 1995-97, Be Incorporated
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SOUND_FILE_H
|
||||
#define _SOUND_FILE_H
|
||||
|
||||
#ifndef _BE_BUILD_H
|
||||
#include <BeBuild.h>
|
||||
#endif
|
||||
#include <MediaDefs.h>
|
||||
#include <Entry.h>
|
||||
#include <File.h>
|
||||
|
||||
enum /* sound_format*/
|
||||
{ B_UNKNOWN_FILE,
|
||||
B_AIFF_FILE,
|
||||
B_WAVE_FILE,
|
||||
B_UNIX_FILE };
|
||||
|
||||
class BSoundFile {
|
||||
|
||||
public:
|
||||
BSoundFile();
|
||||
BSoundFile(const entry_ref *ref,
|
||||
uint32 open_mode);
|
||||
virtual ~BSoundFile();
|
||||
|
||||
status_t InitCheck() const;
|
||||
|
||||
status_t SetTo(const entry_ref *ref, uint32 open_mode);
|
||||
|
||||
int32 FileFormat() const;
|
||||
int32 SamplingRate() const;
|
||||
int32 CountChannels() const;
|
||||
int32 SampleSize() const;
|
||||
int32 ByteOrder() const;
|
||||
int32 SampleFormat() const;
|
||||
int32 FrameSize() const;
|
||||
off_t CountFrames() const;
|
||||
|
||||
bool IsCompressed() const;
|
||||
int32 CompressionType() const;
|
||||
char *CompressionName() const;
|
||||
|
||||
virtual int32 SetFileFormat(int32 format);
|
||||
virtual int32 SetSamplingRate(int32 fps);
|
||||
virtual int32 SetChannelCount(int32 spf);
|
||||
virtual int32 SetSampleSize(int32 bps);
|
||||
virtual int32 SetByteOrder(int32 bord);
|
||||
virtual int32 SetSampleFormat(int32 fmt);
|
||||
virtual int32 SetCompressionType(int32 type);
|
||||
virtual char *SetCompressionName(char *name);
|
||||
virtual bool SetIsCompressed(bool tf);
|
||||
virtual off_t SetDataLocation(off_t offset);
|
||||
virtual off_t SetFrameCount(off_t count);
|
||||
|
||||
size_t ReadFrames(char *buf, size_t count);
|
||||
size_t WriteFrames(char *buf, size_t count);
|
||||
virtual off_t SeekToFrame(off_t n);
|
||||
off_t FrameIndex() const;
|
||||
off_t FramesRemaining() const;
|
||||
|
||||
BFile *fSoundFile;
|
||||
|
||||
private:
|
||||
|
||||
virtual void _ReservedSoundFile1();
|
||||
virtual void _ReservedSoundFile2();
|
||||
virtual void _ReservedSoundFile3();
|
||||
|
||||
int32 fFileFormat;
|
||||
int32 fSamplingRate;
|
||||
int32 fChannelCount;
|
||||
int32 fSampleSize;
|
||||
int32 fByteOrder;
|
||||
int32 fSampleFormat;
|
||||
|
||||
off_t fByteOffset; /* offset to first sample */
|
||||
|
||||
off_t fFrameCount;
|
||||
off_t fFrameIndex;
|
||||
|
||||
bool fIsCompressed;
|
||||
int32 fCompressionType;
|
||||
char *fCompressionName;
|
||||
status_t fCStatus;
|
||||
void _init_raw_stats();
|
||||
status_t _ref_to_file(const entry_ref *ref);
|
||||
BMediaFile *fMediaFile;
|
||||
BMediaTrack *fMediaTrack;
|
||||
uint32 _reserved[2];
|
||||
};
|
||||
|
||||
|
||||
#endif /* #ifndef _SOUND_FILE_H*/
|
||||
@@ -1,193 +0,0 @@
|
||||
/* SoundPlayer.h */
|
||||
/* Copyright 1998 Be Incorporated. All rights reserved. */
|
||||
|
||||
#if !defined(_SOUND_PLAYER_H)
|
||||
#define _SOUND_PLAYER_H
|
||||
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <BufferProducer.h>
|
||||
#include <Locker.h>
|
||||
#include <exception>
|
||||
|
||||
|
||||
class BSound;
|
||||
class sound_error : public exception {
|
||||
const char * m_str_const;
|
||||
public:
|
||||
sound_error(const char * str);
|
||||
const char * what() const;
|
||||
};
|
||||
|
||||
class BSoundPlayer {
|
||||
friend class _SoundPlayNode;
|
||||
public:
|
||||
enum sound_player_notification {
|
||||
B_STARTED = 1,
|
||||
B_STOPPED,
|
||||
B_SOUND_DONE
|
||||
};
|
||||
|
||||
BSoundPlayer(
|
||||
const char * name = NULL,
|
||||
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format) = NULL,
|
||||
void (*Notifier)(void *, sound_player_notification what, ...) = NULL,
|
||||
void * cookie = NULL);
|
||||
BSoundPlayer(
|
||||
const media_raw_audio_format * format,
|
||||
const char * name = NULL,
|
||||
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format) = NULL,
|
||||
void (*Notifier)(void *, sound_player_notification what, ...) = NULL,
|
||||
void * cookie = NULL);
|
||||
BSoundPlayer(
|
||||
const media_node & toNode,
|
||||
const media_multi_audio_format * format = NULL,
|
||||
const char * name = NULL,
|
||||
const media_input * input = NULL,
|
||||
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format) = NULL,
|
||||
void (*Notifier)(void *, sound_player_notification what, ...) = NULL,
|
||||
void * cookie = NULL);
|
||||
virtual ~BSoundPlayer();
|
||||
|
||||
status_t InitCheck(); // new in R4.1
|
||||
media_raw_audio_format Format() const; // new in R4.1
|
||||
|
||||
status_t Start();
|
||||
void Stop(
|
||||
bool block = true,
|
||||
bool flush = true);
|
||||
|
||||
typedef void (*BufferPlayerFunc)(void *, void *, size_t, const media_raw_audio_format &);
|
||||
BufferPlayerFunc BufferPlayer() const;
|
||||
void SetBufferPlayer(
|
||||
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format));
|
||||
typedef void (*EventNotifierFunc)(void *, sound_player_notification what, ...);
|
||||
EventNotifierFunc EventNotifier() const;
|
||||
void SetNotifier(
|
||||
void (*Notifier)(void *, sound_player_notification what, ...));
|
||||
void * Cookie() const;
|
||||
void SetCookie(
|
||||
void * cookie);
|
||||
void SetCallbacks( // atomic change
|
||||
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format) = NULL,
|
||||
void (*Notifier)(void *, sound_player_notification what, ...) = NULL,
|
||||
void * cookie = NULL);
|
||||
|
||||
typedef int32 play_id;
|
||||
|
||||
bigtime_t CurrentTime();
|
||||
bigtime_t PerformanceTime();
|
||||
status_t Preroll();
|
||||
play_id StartPlaying(
|
||||
BSound * sound,
|
||||
bigtime_t at_time = 0);
|
||||
play_id StartPlaying(
|
||||
BSound * sound,
|
||||
bigtime_t at_time,
|
||||
float with_volume);
|
||||
status_t SetSoundVolume(
|
||||
play_id sound, // update only non-NULL values
|
||||
float new_volume);
|
||||
bool IsPlaying(
|
||||
play_id id);
|
||||
status_t StopPlaying(
|
||||
play_id id);
|
||||
status_t WaitForSound(
|
||||
play_id id);
|
||||
|
||||
float Volume(); /* 0 - 1.0 */
|
||||
void SetVolume( /* 0 - 1.0 */
|
||||
float new_volume);
|
||||
float VolumeDB( /* -xx - +xx (see GetVolumeInfo()) */
|
||||
bool forcePoll = false); /* if false, cached value will be used if new enough */
|
||||
void SetVolumeDB(
|
||||
float volume_dB);
|
||||
status_t GetVolumeInfo(
|
||||
media_node * out_node,
|
||||
int32 * out_parameter_id,
|
||||
float * out_min_dB,
|
||||
float * out_max_dB);
|
||||
bigtime_t Latency();
|
||||
|
||||
virtual bool HasData();
|
||||
void SetHasData( // this does more than just set a flag
|
||||
bool has_data);
|
||||
|
||||
protected:
|
||||
|
||||
void SetInitError( // new in R4.1
|
||||
status_t in_error);
|
||||
|
||||
private:
|
||||
|
||||
virtual status_t _Reserved_SoundPlayer_0(void *, ...);
|
||||
virtual status_t _Reserved_SoundPlayer_1(void *, ...);
|
||||
virtual status_t _Reserved_SoundPlayer_2(void *, ...);
|
||||
virtual status_t _Reserved_SoundPlayer_3(void *, ...);
|
||||
virtual status_t _Reserved_SoundPlayer_4(void *, ...);
|
||||
virtual status_t _Reserved_SoundPlayer_5(void *, ...);
|
||||
virtual status_t _Reserved_SoundPlayer_6(void *, ...);
|
||||
virtual status_t _Reserved_SoundPlayer_7(void *, ...);
|
||||
|
||||
_SoundPlayNode * fPlayerNode;
|
||||
struct _playing_sound {
|
||||
_playing_sound * next;
|
||||
off_t cur_offset;
|
||||
BSound * sound;
|
||||
play_id id;
|
||||
int32 delta;
|
||||
int32 rate;
|
||||
float volume;
|
||||
};
|
||||
_playing_sound * _m_sounds;
|
||||
struct _waiting_sound {
|
||||
_waiting_sound * next;
|
||||
bigtime_t start_time;
|
||||
BSound * sound;
|
||||
play_id id;
|
||||
int32 rate;
|
||||
float volume;
|
||||
};
|
||||
_waiting_sound * _m_waiting;
|
||||
void (*fPlayBufferFunc)(void * cookie, void * buffer, size_t size, const media_raw_audio_format & format);
|
||||
void (*fNotifierFunc)(void * cookie, sound_player_notification what, ...);
|
||||
BLocker fLocker;
|
||||
float fVolumeDB;
|
||||
media_input fMediaInput; // the system mixer
|
||||
media_output fMediaOutput; // the player node
|
||||
void * fCookie;
|
||||
int32 fFlags;
|
||||
|
||||
status_t fInitStatus; // new in R4.1
|
||||
BContinuousParameter * fVolumeSlider;
|
||||
bigtime_t fLastVolumeUpdate;
|
||||
BParameterWeb *fParameterWeb;
|
||||
uint32 _m_reserved[15];
|
||||
|
||||
void NotifySoundDone(
|
||||
play_id sound,
|
||||
bool got_to_play);
|
||||
|
||||
void get_volume_slider();
|
||||
void Init(
|
||||
const media_node * node,
|
||||
const media_multi_audio_format * format,
|
||||
const char * name,
|
||||
const media_input * input,
|
||||
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format),
|
||||
void (*Notifier)(void *, sound_player_notification what, ...),
|
||||
void * cookie);
|
||||
// for B_STARTED and B_STOPPED, the argument is BSoundPlayer* (this)
|
||||
// for B_SOUND_DONE, the arguments are play_id and true/false for whether it got to play data at all
|
||||
virtual void Notify(
|
||||
sound_player_notification what,
|
||||
...);
|
||||
// get data into the buffer to play -- this version will use the queued BSound system
|
||||
virtual void PlayBuffer(
|
||||
void * buffer,
|
||||
size_t size,
|
||||
const media_raw_audio_format & format);
|
||||
};
|
||||
|
||||
|
||||
#endif /* _SOUND_PLAYER_H */
|
||||
@@ -1,119 +0,0 @@
|
||||
/*****************************************************************
|
||||
|
||||
File: TimeCode.h
|
||||
|
||||
Description: Time code handling functions and class
|
||||
|
||||
Copyright 1998-, Be Incorporated. All Rights Reserved.
|
||||
|
||||
*****************************************************************/
|
||||
|
||||
#if !defined(_TIME_CODE_H)
|
||||
#define _TIME_CODE_H
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
/* Time code is always in the form HH:MM:SS:FF, it's the definition of FF that varies */
|
||||
enum timecode_type {
|
||||
B_TIMECODE_DEFAULT,
|
||||
B_TIMECODE_100,
|
||||
B_TIMECODE_75, /* CD */
|
||||
B_TIMECODE_30, /* MIDI */
|
||||
B_TIMECODE_30_DROP_2, /* NTSC */
|
||||
B_TIMECODE_30_DROP_4, /* Brazil */
|
||||
B_TIMECODE_25, /* PAL */
|
||||
B_TIMECODE_24, /* Film */
|
||||
B_TIMECODE_18 /* Super8 */
|
||||
};
|
||||
struct timecode_info {
|
||||
timecode_type type;
|
||||
int drop_frames;
|
||||
int every_nth;
|
||||
int except_nth;
|
||||
int fps_div;
|
||||
char name[32]; /* for popup menu etc */
|
||||
char format[32]; /* for sprintf(fmt, h, m, s, f) */
|
||||
char _reserved_[64];
|
||||
};
|
||||
_IMPEXP_MEDIA status_t us_to_timecode(bigtime_t micros, int * hours, int * minutes, int * seconds, int * frames, const timecode_info * code = NULL);
|
||||
_IMPEXP_MEDIA status_t timecode_to_us(int hours, int minutes, int seconds, int frames, bigtime_t * micros, const timecode_info * code = NULL);
|
||||
_IMPEXP_MEDIA status_t frames_to_timecode(int32 l_frames, int * hours, int * minutes, int * seconds, int * frames, const timecode_info * code = NULL);
|
||||
_IMPEXP_MEDIA status_t timecode_to_frames(int hours, int minutes, int seconds, int frames, int32 * l_frames, const timecode_info * code = NULL);
|
||||
_IMPEXP_MEDIA status_t get_timecode_description(timecode_type type, timecode_info * out_timecode);
|
||||
_IMPEXP_MEDIA status_t count_timecodes();
|
||||
/* we may want a set_default_timecode, too -- but that's bad from a thread standpoint */
|
||||
|
||||
|
||||
class BTimeCode {
|
||||
public:
|
||||
BTimeCode();
|
||||
BTimeCode(
|
||||
bigtime_t us,
|
||||
timecode_type type = B_TIMECODE_DEFAULT);
|
||||
BTimeCode(
|
||||
const BTimeCode & clone);
|
||||
BTimeCode(
|
||||
int hours,
|
||||
int minutes,
|
||||
int seconds,
|
||||
int frames,
|
||||
timecode_type type = B_TIMECODE_DEFAULT);
|
||||
~BTimeCode();
|
||||
|
||||
void SetData(
|
||||
int hours,
|
||||
int minutes,
|
||||
int seconds,
|
||||
int frames);
|
||||
status_t SetType(
|
||||
timecode_type type);
|
||||
void SetMicroseconds(
|
||||
bigtime_t us);
|
||||
void SetLinearFrames(
|
||||
int32 linear_frames);
|
||||
|
||||
BTimeCode & operator=(
|
||||
const BTimeCode & clone);
|
||||
bool operator==(
|
||||
const BTimeCode & other) const;
|
||||
bool operator<(
|
||||
const BTimeCode & other) const;
|
||||
|
||||
BTimeCode & operator+=(
|
||||
const BTimeCode & other);
|
||||
BTimeCode & operator-=(
|
||||
const BTimeCode & other);
|
||||
|
||||
BTimeCode operator+(
|
||||
const BTimeCode & other) const;
|
||||
BTimeCode operator-(
|
||||
const BTimeCode & other) const;
|
||||
|
||||
int Hours() const;
|
||||
int Minutes() const;
|
||||
int Seconds() const;
|
||||
int Frames() const;
|
||||
timecode_type Type() const;
|
||||
void GetData(
|
||||
int * out_hours,
|
||||
int * out_minutes,
|
||||
int * out_seconds,
|
||||
int * out_frames,
|
||||
timecode_type * out_type = NULL) const;
|
||||
|
||||
bigtime_t Microseconds() const;
|
||||
int32 LinearFrames() const;
|
||||
void GetString(
|
||||
char * str) const; /* at least 24 bytes */
|
||||
|
||||
private:
|
||||
int m_hours;
|
||||
int m_minutes;
|
||||
int m_seconds;
|
||||
int m_frames;
|
||||
timecode_info m_info;
|
||||
};
|
||||
|
||||
|
||||
#endif /* _TIME_CODE_H */
|
||||
@@ -1,150 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: TimeSource.h
|
||||
/
|
||||
/ Description: A BTimeSource is something to which others can slave timing information
|
||||
/ using the Media Kit.
|
||||
/
|
||||
/ Copyright 1997-98, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(_TIME_SOURCE_H)
|
||||
#define _TIME_SOURCE_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaNode.h>
|
||||
|
||||
|
||||
class _BSlaveNodeStorageP;
|
||||
|
||||
namespace BPrivate { namespace media {
|
||||
class BMediaRosterEx;
|
||||
class TimeSourceObject;
|
||||
class SystemTimeSourceObject;
|
||||
class SlaveNodes;
|
||||
struct TimeSourceTransmit;
|
||||
} }
|
||||
|
||||
|
||||
class BTimeSource :
|
||||
public virtual BMediaNode
|
||||
{
|
||||
protected:
|
||||
/* this has to be at the top to force a vtable */
|
||||
virtual ~BTimeSource();
|
||||
|
||||
public:
|
||||
|
||||
virtual status_t SnoozeUntil( /* returns error if stopped */
|
||||
bigtime_t performance_time,
|
||||
bigtime_t with_latency = 0,
|
||||
bool retry_signals = false);
|
||||
|
||||
bigtime_t Now(); /* convenience, less accurate */
|
||||
bigtime_t PerformanceTimeFor( /* all three go through GetTime() */
|
||||
bigtime_t real_time);
|
||||
bigtime_t RealTimeFor(
|
||||
bigtime_t performance_time,
|
||||
bigtime_t with_latency);
|
||||
bool IsRunning();
|
||||
|
||||
status_t GetTime( /* return B_OK if reading is usable */
|
||||
bigtime_t * performance_time,
|
||||
bigtime_t * real_time,
|
||||
float * drift);
|
||||
|
||||
static bigtime_t RealTime(); /* this produces real time, nothing else is guaranteed to */
|
||||
|
||||
status_t GetStartLatency(
|
||||
bigtime_t * out_latency);
|
||||
|
||||
protected:
|
||||
|
||||
BTimeSource();
|
||||
|
||||
virtual status_t HandleMessage(
|
||||
int32 message,
|
||||
const void * data,
|
||||
size_t size);
|
||||
|
||||
void PublishTime( /* call this at convenient times to update approximation */
|
||||
bigtime_t performance_time,
|
||||
bigtime_t real_time,
|
||||
float drift);
|
||||
|
||||
void BroadcastTimeWarp(
|
||||
bigtime_t at_real_time,
|
||||
bigtime_t new_performance_time); /* when running */
|
||||
void SendRunMode(
|
||||
run_mode mode);
|
||||
|
||||
virtual void SetRunMode(
|
||||
run_mode mode); /* or, instead, SendRunMode() */
|
||||
|
||||
enum time_source_op {
|
||||
B_TIMESOURCE_START = 1,
|
||||
B_TIMESOURCE_STOP,
|
||||
B_TIMESOURCE_STOP_IMMEDIATELY,
|
||||
B_TIMESOURCE_SEEK
|
||||
};
|
||||
struct time_source_op_info {
|
||||
time_source_op op;
|
||||
int32 _reserved1;
|
||||
bigtime_t real_time;
|
||||
bigtime_t performance_time;
|
||||
int32 _reserved2[6];
|
||||
};
|
||||
virtual status_t TimeSourceOp(
|
||||
const time_source_op_info & op,
|
||||
void * _reserved) = 0;
|
||||
|
||||
private:
|
||||
|
||||
friend class BMediaNode;
|
||||
friend class BMediaRoster;
|
||||
friend class BPrivate::media::BMediaRosterEx;
|
||||
friend class BPrivate::media::TimeSourceObject;
|
||||
friend class BPrivate::media::SystemTimeSourceObject;
|
||||
|
||||
BTimeSource( /* private unimplemented */
|
||||
const BTimeSource & clone);
|
||||
BTimeSource & operator=(
|
||||
const BTimeSource & clone);
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
status_t _Reserved_TimeSource_0(void *); // TimeSourceOp()
|
||||
virtual status_t _Reserved_TimeSource_1(void *);
|
||||
virtual status_t _Reserved_TimeSource_2(void *);
|
||||
virtual status_t _Reserved_TimeSource_3(void *);
|
||||
virtual status_t _Reserved_TimeSource_4(void *);
|
||||
virtual status_t _Reserved_TimeSource_5(void *);
|
||||
|
||||
bool fStarted;
|
||||
area_id fArea;
|
||||
volatile BPrivate::media::TimeSourceTransmit *fBuf;
|
||||
BPrivate::media::SlaveNodes *fSlaveNodes;
|
||||
|
||||
area_id _reserved_area;
|
||||
bool fIsRealtime;
|
||||
bool _reserved_bool_[3];
|
||||
uint32 _reserved_time_source_[10];
|
||||
|
||||
explicit BTimeSource(
|
||||
media_node_id id);
|
||||
void FinishCreate(); /* called by roster and/or server */
|
||||
|
||||
virtual status_t RemoveMe(BMediaNode * node);
|
||||
virtual status_t AddMe(BMediaNode * node);
|
||||
|
||||
void DirectStart(bigtime_t at);
|
||||
void DirectStop(bigtime_t at, bool immediate);
|
||||
void DirectSeek(bigtime_t to, bigtime_t at);
|
||||
void DirectSetRunMode(run_mode mode);
|
||||
void DirectAddMe(const media_node &node);
|
||||
void DirectRemoveMe(const media_node &node);
|
||||
};
|
||||
|
||||
|
||||
#endif /* _TIME_SOURCE_H */
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: TimedEventQueue.h
|
||||
/
|
||||
/ Description: A priority queue for holding media_timed_events.
|
||||
/ Sorts by increasing time, so events near the front
|
||||
/ of the queue are to occur earlier.
|
||||
/
|
||||
/ Copyright 1999, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _TIMED_EVENT_QUEUE_H
|
||||
#define _TIMED_EVENT_QUEUE_H
|
||||
|
||||
#include <MediaDefs.h>
|
||||
|
||||
struct _event_queue_imp;
|
||||
|
||||
|
||||
struct media_timed_event {
|
||||
media_timed_event();
|
||||
media_timed_event(bigtime_t inTime, int32 inType);
|
||||
media_timed_event(bigtime_t inTime, int32 inType,
|
||||
void *inPointer, uint32 inCleanup);
|
||||
media_timed_event(
|
||||
bigtime_t inTime, int32 inType,
|
||||
void *inPointer, uint32 inCleanup,
|
||||
int32 inData, int64 inBigdata,
|
||||
char *inUserData, size_t dataSize = 0);
|
||||
|
||||
media_timed_event(const media_timed_event & clone);
|
||||
void operator=(const media_timed_event & clone);
|
||||
|
||||
~media_timed_event();
|
||||
|
||||
bigtime_t event_time;
|
||||
int32 type;
|
||||
void * pointer;
|
||||
uint32 cleanup;
|
||||
int32 data;
|
||||
int64 bigdata;
|
||||
char user_data[64];
|
||||
uint32 _reserved_media_timed_event_[8];
|
||||
};
|
||||
|
||||
_IMPEXP_MEDIA bool operator==(const media_timed_event & a, const media_timed_event & b);
|
||||
_IMPEXP_MEDIA bool operator!=(const media_timed_event & a, const media_timed_event & b);
|
||||
_IMPEXP_MEDIA bool operator<(const media_timed_event & a, const media_timed_event & b);
|
||||
_IMPEXP_MEDIA bool operator>(const media_timed_event & a, const media_timed_event &b);
|
||||
|
||||
|
||||
class BTimedEventQueue {
|
||||
public:
|
||||
|
||||
enum event_type {
|
||||
B_NO_EVENT = -1, // never push this type! it will fail
|
||||
B_ANY_EVENT = 0, // never push this type! it will fail
|
||||
B_START,
|
||||
B_STOP,
|
||||
B_SEEK,
|
||||
B_WARP,
|
||||
B_TIMER,
|
||||
B_HANDLE_BUFFER,
|
||||
B_DATA_STATUS,
|
||||
B_HARDWARE,
|
||||
B_PARAMETER,
|
||||
/* user defined events above this value */
|
||||
B_USER_EVENT = 0x4000
|
||||
};
|
||||
|
||||
enum cleanup_flag {
|
||||
B_NO_CLEANUP = 0,
|
||||
B_RECYCLE_BUFFER, // recycle buffers handled by BTimedEventQueue
|
||||
B_EXPIRE_TIMER, // call TimerExpired() on the event->data
|
||||
B_USER_CLEANUP = 0x4000 // others go to the cleanup func
|
||||
};
|
||||
|
||||
enum time_direction {
|
||||
B_ALWAYS = -1,
|
||||
B_BEFORE_TIME = 0,
|
||||
B_AT_TIME,
|
||||
B_AFTER_TIME
|
||||
};
|
||||
|
||||
|
||||
void * operator new(size_t s);
|
||||
void operator delete(void * p, size_t s);
|
||||
|
||||
BTimedEventQueue();
|
||||
virtual ~BTimedEventQueue();
|
||||
|
||||
status_t AddEvent(const media_timed_event &event);
|
||||
status_t RemoveEvent(const media_timed_event *event);
|
||||
status_t RemoveFirstEvent(media_timed_event * outEvent = NULL);
|
||||
|
||||
bool HasEvents() const;
|
||||
int32 EventCount() const;
|
||||
|
||||
/* Accessors */
|
||||
const media_timed_event * FirstEvent() const;
|
||||
bigtime_t FirstEventTime() const;
|
||||
const media_timed_event * LastEvent() const;
|
||||
bigtime_t LastEventTime() const;
|
||||
|
||||
const media_timed_event * FindFirstMatch(
|
||||
bigtime_t eventTime,
|
||||
time_direction direction,
|
||||
bool inclusive = true,
|
||||
int32 eventType = B_ANY_EVENT);
|
||||
|
||||
|
||||
/* queue manipulation */
|
||||
/* call DoForEach to perform a function on each event in the */
|
||||
/* queue. Return an appropriate status defining an action to take */
|
||||
/* for that event. DoForEach is an atomic operation ensuring the */
|
||||
/* consistency of the queue during the call. */
|
||||
enum queue_action {
|
||||
B_DONE = -1,
|
||||
B_NO_ACTION = 0,
|
||||
B_REMOVE_EVENT,
|
||||
B_RESORT_QUEUE
|
||||
};
|
||||
typedef queue_action (*for_each_hook)(media_timed_event *event, void *context);
|
||||
|
||||
status_t DoForEach(
|
||||
for_each_hook hook,
|
||||
void *context,
|
||||
bigtime_t eventTime = 0,
|
||||
time_direction direction = B_ALWAYS,
|
||||
bool inclusive = true,
|
||||
int32 eventType = B_ANY_EVENT);
|
||||
|
||||
|
||||
/* flushing events */
|
||||
/* the cleanup hook is called when events are flushed from the queue */
|
||||
/* and the cleanup is not B_NO_CLEANUP or B_RECYCLE_BUFFER */
|
||||
typedef void (*cleanup_hook)(const media_timed_event *event, void * context);
|
||||
void SetCleanupHook(cleanup_hook hook, void *context);
|
||||
status_t FlushEvents(
|
||||
bigtime_t eventTime,
|
||||
time_direction direction,
|
||||
bool inclusive = true,
|
||||
int32 eventType = B_ANY_EVENT);
|
||||
|
||||
|
||||
private:
|
||||
BTimedEventQueue( //unimplemented
|
||||
const BTimedEventQueue & other);
|
||||
BTimedEventQueue &operator =( //unimplemented
|
||||
const BTimedEventQueue & other);
|
||||
|
||||
|
||||
/* hide actual queue implementation */
|
||||
_event_queue_imp * fImp;
|
||||
|
||||
/* Mmmh, stuffing! */
|
||||
virtual status_t _Reserved_BTimedEventQueue_0(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_1(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_2(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_3(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_4(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_5(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_6(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_7(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_8(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_9(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_10(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_11(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_12(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_13(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_14(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_15(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_16(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_17(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_18(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_19(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_20(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_21(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_22(void *, ...);
|
||||
virtual status_t _Reserved_BTimedEventQueue_23(void *, ...);
|
||||
|
||||
uint32 _reserved_timed_event_queue_[6];
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user