* Rewrote last of the MediaKit headers.

* Removed private types from MediaEncoder.h (These have Haiku counterparts,
  I expect MediaEncoder is not yet implemented...)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32787 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-08-28 15:06:12 +00:00
parent 224f4fcd63
commit cb5961b774
2 changed files with 156 additions and 162 deletions
-8
View File
@@ -9,12 +9,6 @@
#include <MediaFormats.h> #include <MediaFormats.h>
//namespace BPrivate {
// class Encoder;
// class _AddonManager;
//}
class BMediaEncoder { class BMediaEncoder {
public: public:
BMediaEncoder(); BMediaEncoder();
@@ -78,8 +72,6 @@ private:
void Init(); void Init();
void ReleaseEncoder(); void ReleaseEncoder();
// BPrivate::_AddonManager* fEncoderMgr;
// BPrivate::Encoder* fEncoder;
uint32 _reserved_was_fEncoderMgr; uint32 _reserved_was_fEncoderMgr;
uint32 _reserved_was_fEncoder; uint32 _reserved_was_fEncoder;
+56 -54
View File
@@ -1,15 +1,7 @@
/******************************************************************************* /*
/ * Copyright 2009, Haiku, Inc. All rights reserved.
/ File: TimedEventQueue.h * Distributed under the terms of the MIT License.
/ */
/ 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 #ifndef _TIMED_EVENT_QUEUE_H
#define _TIMED_EVENT_QUEUE_H #define _TIMED_EVENT_QUEUE_H
@@ -20,20 +12,25 @@ struct _event_queue_imp;
struct media_timed_event { struct media_timed_event {
media_timed_event(); media_timed_event();
media_timed_event(bigtime_t inTime, int32 inType); media_timed_event(bigtime_t inTime,
media_timed_event(bigtime_t inTime, int32 inType, int32 inType);
void *inPointer, uint32 inCleanup); media_timed_event(bigtime_t inTime,
int32 inType, void*inPointer,
uint32 inCleanup);
media_timed_event( media_timed_event(
bigtime_t inTime, int32 inType, bigtime_t inTime, int32 inType,
void* inPointer, uint32 inCleanup, void* inPointer, uint32 inCleanup,
int32 inData, int64 inBigdata, int32 inData, int64 inBigdata,
char* inUserData, size_t dataSize = 0); char* inUserData, size_t dataSize = 0);
media_timed_event(const media_timed_event & clone); media_timed_event(
void operator=(const media_timed_event & clone); const media_timed_event& other);
~media_timed_event(); ~media_timed_event();
// TODO: Should this not return "media_timed_event&" ?!
void operator=(const media_timed_event& other);
bigtime_t event_time; bigtime_t event_time;
int32 type; int32 type;
void* pointer; void* pointer;
@@ -41,21 +38,26 @@ struct media_timed_event {
int32 data; int32 data;
int64 bigdata; int64 bigdata;
char user_data[64]; char user_data[64];
uint32 _reserved_media_timed_event_[8]; uint32 _reserved_media_timed_event_[8];
}; };
bool operator==(const media_timed_event& a, const media_timed_event& b); bool operator==(const media_timed_event& a, const media_timed_event& b);
bool operator!=(const media_timed_event& a, const media_timed_event& b); bool operator!=(const media_timed_event& a, const media_timed_event& b);
bool operator<(const media_timed_event& a, const media_timed_event& b); bool operator<(const media_timed_event& a, const media_timed_event& b);
bool operator>(const media_timed_event& a, const media_timed_event&b); bool operator>(const media_timed_event& a, const media_timed_event&b);
/*! A priority queue for holding media_timed_events. Sorts by increasing time,
so events near the front of the queue are to occur earlier.
*/
class BTimedEventQueue { class BTimedEventQueue {
public: public:
enum event_type { enum event_type {
B_NO_EVENT = -1, // never push this type! it will fail B_NO_EVENT = -1, // Pushing this type will always fail.
B_ANY_EVENT = 0, // never push this type! it will fail B_ANY_EVENT = 0, // Pushing this type will always fail.
B_START, B_START,
B_STOP, B_STOP,
B_SEEK, B_SEEK,
@@ -65,15 +67,18 @@ class BTimedEventQueue {
B_DATA_STATUS, B_DATA_STATUS,
B_HARDWARE, B_HARDWARE,
B_PARAMETER, B_PARAMETER,
/* user defined events above this value */
// User defined events are greater than this value.
B_USER_EVENT = 0x4000 B_USER_EVENT = 0x4000
}; };
enum cleanup_flag { enum cleanup_flag {
B_NO_CLEANUP = 0, B_NO_CLEANUP = 0,
B_RECYCLE_BUFFER, // recycle buffers handled by BTimedEventQueue B_RECYCLE_BUFFER, // Specifies to recycle buffers handled by
B_EXPIRE_TIMER, // call TimerExpired() on the event->data // BTimedEventQueue.
B_USER_CLEANUP = 0x4000 // others go to the cleanup func B_EXPIRE_TIMER, // Specifies to call TimerExpired() on the
// event->data.
B_USER_CLEANUP = 0x4000
}; };
enum time_direction { enum time_direction {
@@ -84,77 +89,71 @@ class BTimedEventQueue {
}; };
void * operator new(size_t s); void* operator new(size_t size);
void operator delete(void * p, size_t s); void operator delete(void* ptr, size_t size);
BTimedEventQueue(); BTimedEventQueue();
virtual ~BTimedEventQueue(); virtual ~BTimedEventQueue();
status_t AddEvent(const media_timed_event& event); status_t AddEvent(const media_timed_event& event);
status_t RemoveEvent(const media_timed_event* event); status_t RemoveEvent(const media_timed_event* event);
status_t RemoveFirstEvent(media_timed_event * outEvent = NULL); status_t RemoveFirstEvent(
media_timed_event* _event = NULL);
bool HasEvents() const; bool HasEvents() const;
int32 EventCount() const; int32 EventCount() const;
/* Accessors */
const media_timed_event* FirstEvent() const; const media_timed_event* FirstEvent() const;
bigtime_t FirstEventTime() const; bigtime_t FirstEventTime() const;
const media_timed_event* LastEvent() const; const media_timed_event* LastEvent() const;
bigtime_t LastEventTime() const; bigtime_t LastEventTime() const;
const media_timed_event * FindFirstMatch( const media_timed_event* FindFirstMatch(bigtime_t eventTime,
bigtime_t eventTime,
time_direction direction, time_direction direction,
bool inclusive = true, bool inclusive = true,
int32 eventType = B_ANY_EVENT); int32 eventType = B_ANY_EVENT);
/* queue manipulation */ // Queue manipulation
/* call DoForEach to perform a function on each event in the */ // Call DoForEach to perform a function on each event in the queue.
/* queue. Return an appropriate status defining an action to take */ // Return an appropriate status defining an action to take for that event.
/* for that event. DoForEach is an atomic operation ensuring the */ // DoForEach is an atomic operation ensuring the consistency of the queue
/* consistency of the queue during the call. */ // during the call.
enum queue_action { enum queue_action {
B_DONE = -1, B_DONE = -1,
B_NO_ACTION = 0, B_NO_ACTION = 0,
B_REMOVE_EVENT, B_REMOVE_EVENT,
B_RESORT_QUEUE B_RESORT_QUEUE
}; };
typedef queue_action (*for_each_hook)(media_timed_event *event, void *context); typedef queue_action (*for_each_hook)(media_timed_event* event,
void* context);
status_t DoForEach( status_t DoForEach(for_each_hook hook, void* context,
for_each_hook hook,
void *context,
bigtime_t eventTime = 0, bigtime_t eventTime = 0,
time_direction direction = B_ALWAYS, time_direction direction = B_ALWAYS,
bool inclusive = true, bool inclusive = true,
int32 eventType = B_ANY_EVENT); int32 eventType = B_ANY_EVENT);
/* flushing events */ // Flushing events
/* the cleanup hook is called when events are flushed from the queue */ // The cleanup hook is called when events are flushed from the queue and
/* and the cleanup is not B_NO_CLEANUP or B_RECYCLE_BUFFER */ // the cleanup is not B_NO_CLEANUP or B_RECYCLE_BUFFER.
typedef void (*cleanup_hook)(const media_timed_event *event, void * context); typedef void (*cleanup_hook)(const media_timed_event* event,
void SetCleanupHook(cleanup_hook hook, void *context); void* context);
status_t FlushEvents( void SetCleanupHook(cleanup_hook hook,
bigtime_t eventTime, void* context);
status_t FlushEvents(bigtime_t eventTime,
time_direction direction, time_direction direction,
bool inclusive = true, bool inclusive = true,
int32 eventType = B_ANY_EVENT); int32 eventType = B_ANY_EVENT);
private: private:
BTimedEventQueue( //unimplemented // FBC padding and forbidden methods
const BTimedEventQueue & other); BTimedEventQueue(
BTimedEventQueue &operator =( //unimplemented
const BTimedEventQueue& other); const BTimedEventQueue& other);
BTimedEventQueue& operator=(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_0(void*, ...);
virtual status_t _Reserved_BTimedEventQueue_1(void*, ...); virtual status_t _Reserved_BTimedEventQueue_1(void*, ...);
virtual status_t _Reserved_BTimedEventQueue_2(void*, ...); virtual status_t _Reserved_BTimedEventQueue_2(void*, ...);
@@ -180,6 +179,9 @@ class BTimedEventQueue {
virtual status_t _Reserved_BTimedEventQueue_22(void*, ...); virtual status_t _Reserved_BTimedEventQueue_22(void*, ...);
virtual status_t _Reserved_BTimedEventQueue_23(void*, ...); virtual status_t _Reserved_BTimedEventQueue_23(void*, ...);
private:
_event_queue_imp* fImp;
uint32 _reserved_timed_event_queue_[6]; uint32 _reserved_timed_event_queue_[6];
}; };