1 // Copyright (c) 1998-99, Be Incorporated, All Rights Reserved.
4 #ifndef VIDEO_CONSUMER_H
5 #define VIDEO_CONSUMER_H
9 #include <BufferConsumer.h>
10 #include <MediaEventLooper.h>
11 #include <MediaNode.h>
12 #include <TimedEventQueue.h>
13 #include <TranslationKit.h>
25 char fileNameText
[64];
28 char passwordText
[64];
29 char directoryText
[64];
32 #define FTP_INFO 0x60000001
38 class VideoConsumer
: public BMediaEventLooper
, public BBufferConsumer
{
40 VideoConsumer(const char* name
, BView
* view
, BStringView
* statusLine
,
41 BMediaAddOn
*addon
, const uint32 internalId
);
46 virtual BMediaAddOn
* AddOn(int32
* cookie
) const;
49 virtual void Start(bigtime_t performanceTime
);
50 virtual void Stop(bigtime_t performanceTime
, bool immediate
);
51 virtual void Seek(bigtime_t mediaTime
, bigtime_t performanceTime
);
52 virtual void TimeWarp(bigtime_t atRealTime
,
53 bigtime_t toPerformanceTime
);
55 virtual void NodeRegistered();
56 virtual status_t
RequestCompleted(const media_request_info
& info
);
58 virtual status_t
HandleMessage(int32 message
, const void* data
,
61 virtual status_t
DeleteHook(BMediaNode
* node
);
63 /* BMediaEventLooper */
65 virtual void HandleEvent(const media_timed_event
* event
,
66 bigtime_t lateness
, bool realTimeEvent
);
70 virtual status_t
AcceptFormat(const media_destination
& dest
,
71 media_format
* format
);
73 virtual status_t
GetNextInput(int32
* cookie
, media_input
* outInput
);
75 virtual void DisposeInputCookie(int32 cookie
);
78 virtual void BufferReceived(BBuffer
* buffer
);
81 virtual void ProducerDataStatus(const media_destination
&forWhom
,
82 int32 status
, bigtime_t atMediaTime
);
84 virtual status_t
GetLatencyFor(const media_destination
& forWhom
,
85 bigtime_t
* outLatency
, media_node_id
* outId
);
87 virtual status_t
Connected(const media_source
& producer
,
88 const media_destination
& where
, const media_format
& withFormat
,
89 media_input
* outInput
);
91 virtual void Disconnected(const media_source
& producer
,
92 const media_destination
& where
);
94 virtual status_t
FormatChanged(const media_source
& producer
,
95 const media_destination
& consumer
, int32 fromChangeCount
,
96 const media_format
& format
);
101 status_t
CreateBuffers(const media_format
& withFormat
);
103 void DeleteBuffers();
105 static status_t
FtpRun(void* data
);
109 void UpdateFtpStatus(const char* status
);
111 status_t
LocalSave(char* filename
, BBitmap
* bitmap
);
113 status_t
FtpSave(char* filename
);
116 BStringView
* fStatusLine
;
120 thread_id fFtpThread
;
122 bool fConnectionActive
;
124 media_destination fDestination
;
125 bigtime_t fMyLatency
;
131 BBufferGroup
* fBuffers
;
132 BBuffer
* fBufferMap
[3];
135 volatile bool fTimeToFtp
;
136 volatile bool fFtpComplete
;
143 char fFileNameText
[64];
144 char fServerText
[64];
146 char fPasswordText
[64];
147 char fDirectoryText
[64];
150 #endif // VIDEO_CONSUMER_H