Go to the source code of this file.
|
| #define | DO_RUNNING_AVG(avg, val, size) (((val) + ((size)-1) * (avg)) / (size)) |
| |
| #define | UPDATE_RUNNING_AVG(avg, val) DO_RUNNING_AVG(avg,val,8) |
| |
| #define | UPDATE_RUNNING_AVG_P(avg, val) DO_RUNNING_AVG(avg,val,16) |
| |
| #define | UPDATE_RUNNING_AVG_N(avg, val) DO_RUNNING_AVG(avg,val,4) |
| |
|
| | WINE_DEFAULT_DEBUG_CHANNEL (quartz) |
| |
| static void | reset_qos (struct strmbase_renderer *filter) |
| |
| static void | perform_qos (struct strmbase_renderer *filter, const REFERENCE_TIME start, const REFERENCE_TIME stop, REFERENCE_TIME jitter) |
| |
| static struct strmbase_renderer * | impl_from_strmbase_filter (struct strmbase_filter *iface) |
| |
| static struct strmbase_renderer * | impl_from_IPin (IPin *iface) |
| |
| static struct strmbase_pin * | renderer_get_pin (struct strmbase_filter *iface, unsigned int index) |
| |
| static void | renderer_destroy (struct strmbase_filter *iface) |
| |
| static HRESULT | renderer_query_interface (struct strmbase_filter *iface, REFIID iid, void **out) |
| |
| static HRESULT | renderer_init_stream (struct strmbase_filter *iface) |
| |
| static HRESULT | renderer_start_stream (struct strmbase_filter *iface, REFERENCE_TIME start) |
| |
| static HRESULT | renderer_stop_stream (struct strmbase_filter *iface) |
| |
| static HRESULT | renderer_cleanup_stream (struct strmbase_filter *iface) |
| |
| static HRESULT | renderer_wait_state (struct strmbase_filter *iface, DWORD timeout) |
| |
| static HRESULT | sink_query_accept (struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt) |
| |
| static HRESULT | sink_query_interface (struct strmbase_pin *iface, REFIID iid, void **out) |
| |
| static HRESULT WINAPI | BaseRenderer_Receive (struct strmbase_sink *pin, IMediaSample *sample) |
| |
| static HRESULT | sink_connect (struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt) |
| |
| static void | sink_disconnect (struct strmbase_sink *iface) |
| |
| static HRESULT | sink_eos (struct strmbase_sink *iface) |
| |
| static HRESULT | sink_begin_flush (struct strmbase_sink *iface) |
| |
| static HRESULT | sink_end_flush (struct strmbase_sink *iface) |
| |
| static struct strmbase_renderer * | impl_from_IQualityControl (IQualityControl *iface) |
| |
| static HRESULT WINAPI | quality_control_QueryInterface (IQualityControl *iface, REFIID iid, void **out) |
| |
| static ULONG WINAPI | quality_control_AddRef (IQualityControl *iface) |
| |
| static ULONG WINAPI | quality_control_Release (IQualityControl *iface) |
| |
| static HRESULT WINAPI | quality_control_Notify (IQualityControl *iface, IBaseFilter *sender, Quality q) |
| |
| static HRESULT WINAPI | quality_control_SetSink (IQualityControl *iface, IQualityControl *sink) |
| |
| void | strmbase_renderer_cleanup (struct strmbase_renderer *filter) |
| |
| void | strmbase_renderer_init (struct strmbase_renderer *filter, IUnknown *outer, const CLSID *clsid, const WCHAR *sink_name, const struct strmbase_renderer_ops *ops) |
| |
◆ DO_RUNNING_AVG
◆ UPDATE_RUNNING_AVG
◆ UPDATE_RUNNING_AVG_N
◆ UPDATE_RUNNING_AVG_P
◆ BaseRenderer_Receive()
Definition at line 335 of file renderer.c.
336{
343
346
348 if (
state == State_Stopped)
350
351 if (IMediaSample_GetMediaType(
sample, &mt) ==
S_OK)
352 {
353 TRACE(
"Format change.\n");
355
359 }
360
362 {
365 }
366
367 if (
state == State_Paused)
368 {
370
372
374
379
381 }
382
383 if (need_wait)
384 {
387
389
390
391
393
394 if (jitter <= -10000)
395 {
398
401
404
406 {
407 TRACE(
"Flush signaled; discarding current sample.\n");
409 }
410 }
411
412 if (
state == State_Running)
414
416 }
417 else
418 {
419 if (
state == State_Running)
421 }
422
424}
static struct strmbase_renderer * impl_from_IPin(IPin *iface)
static void perform_qos(struct strmbase_renderer *filter, const REFERENCE_TIME start, const REFERENCE_TIME stop, REFERENCE_TIME jitter)
void strmbase_passthrough_update_time(struct strmbase_passthrough *passthrough, REFERENCE_TIME time)
void strmbase_dump_media_type(const AM_MEDIA_TYPE *mt)
void WINAPI DeleteMediaType(AM_MEDIA_TYPE *pMediaType)
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
static EFI_HANDLE * handles
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_E_WRONG_STATE
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
◆ impl_from_IPin()
◆ impl_from_IQualityControl()
◆ impl_from_strmbase_filter()
◆ perform_qos()
Definition at line 66 of file renderer.c.
68{
71
72 if (jitter < 0)
73 {
74
76 entered = 0;
77 else
78 entered =
start + jitter;
80 }
81 else
82 {
83
84 entered =
start + jitter;
85
87 }
88
89
91 duration = stop -
start;
92 else
93 duration = 0;
94
95
96
97 if (
filter->last_left >= 0)
98 {
99 if (entered >
filter->last_left)
101 else
103 }
104 else
105 {
107 }
108
109 TRACE(
"start %s, entered %s, left %s, pt %s, duration %s, jitter %s.\n",
112
113 TRACE(
"average duration %s, average pt %s, average rate %.16e.\n",
115
116
117 if (
filter->avg_duration < 0)
118 filter->avg_duration = duration;
119 else
121
124 else
126
127 if (
filter->avg_duration != 0)
129 else
131
132 if (
filter->last_left >= 0)
133 {
134 if (
filter->avg_rate < 0.0)
135 {
137 }
138 else
139 {
142 else
144 }
145 }
146
147 if (
filter->avg_rate >= 0.0)
148 {
150
151
152 if (jitter < 0)
153 {
154
155
158 }
159 else
160 {
161 jitter += stop -
start;
162 }
163
164 q.Type = (jitter > 0 ? Famine : Flood);
165 q.Proportion = 1000.0 /
filter->avg_rate;
166 if (
q.Proportion < 200)
168 else if (
q.Proportion > 5000)
172 IQualityControl_Notify(&
filter->IQualityControl_iface, &
filter->
filter.IBaseFilter_iface,
q);
173 }
174
175
177}
GLdouble GLdouble GLdouble GLdouble q
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
#define UPDATE_RUNNING_AVG_N(avg, val)
#define UPDATE_RUNNING_AVG(avg, val)
#define UPDATE_RUNNING_AVG_P(avg, val)
static const char * debugstr_time(REFERENCE_TIME time)
Referenced by BaseRenderer_Receive().
◆ quality_control_AddRef()
Definition at line 512 of file renderer.c.
513{
516}
static struct strmbase_renderer * impl_from_IQualityControl(IQualityControl *iface)
◆ quality_control_Notify()
Definition at line 524 of file renderer.c.
525{
528
529 TRACE(
"filter %p, sender %p, type %#x, proportion %ld, late %s, timestamp %s.\n",
531
534
535 if (
filter->sink.pin.peer)
536 {
538 IPin_QueryInterface(
filter->sink.pin.peer, &IID_IQualityControl, (
void **)&peer_qc);
539 if (peer_qc)
540 {
541 hr = IQualityControl_Notify(peer_qc, &
filter->
filter.IBaseFilter_iface,
q);
542 IQualityControl_Release(peer_qc);
543 }
544 }
545
547}
◆ quality_control_QueryInterface()
Definition at line 506 of file renderer.c.
507{
510}
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
◆ quality_control_Release()
◆ quality_control_SetSink()
◆ renderer_cleanup_stream()
Definition at line 279 of file renderer.c.
280{
282
286
288}
static struct strmbase_renderer * impl_from_strmbase_filter(struct strmbase_filter *iface)
void strmbase_passthrough_invalidate_time(struct strmbase_passthrough *passthrough)
◆ renderer_destroy()
◆ renderer_get_pin()
◆ renderer_init_stream()
Definition at line 228 of file renderer.c.
229{
231
232 if (
filter->sink.pin.peer)
236 if (
filter->ops->renderer_init_stream)
238
240}
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
◆ renderer_query_interface()
Definition at line 204 of file renderer.c.
205{
208
209 if (
filter->ops->renderer_query_interface
211 {
213 }
214
216 *
out = &
filter->passthrough.IMediaPosition_iface;
221 else
223
226}
#define IsEqualGUID(rguid1, rguid2)
IMediaSeeking IMediaSeeking_iface
◆ renderer_start_stream()
Definition at line 242 of file renderer.c.
243{
247
252 if (
filter->sink.pin.peer &&
filter->ops->renderer_start_stream)
254
257 &IID_IMediaEventSink, (void **)&event_sink)))
258 {
261 IMediaEventSink_Release(event_sink);
262 }
263
265}
static void reset_qos(struct strmbase_renderer *filter)
◆ renderer_stop_stream()
Definition at line 267 of file renderer.c.
268{
270
272
273 if (
filter->sink.pin.peer &&
filter->ops->renderer_stop_stream)
275
277}
◆ renderer_wait_state()
Definition at line 290 of file renderer.c.
291{
293
297}
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define VFW_S_STATE_INTERMEDIATE
◆ reset_qos()
◆ sink_begin_flush()
◆ sink_connect()
Definition at line 426 of file renderer.c.
427{
429
430 if (
filter->ops->renderer_connect)
433}
◆ sink_disconnect()
Definition at line 435 of file renderer.c.
436{
438
439 if (
filter->ops->renderer_disconnect)
441}
◆ sink_end_flush()
◆ sink_eos()
Definition at line 443 of file renderer.c.
444{
448
450
453 &IID_IMediaEventSink, (void **)&event_sink)))
454 {
457 IMediaEventSink_Release(event_sink);
458 }
461
463}
void strmbase_passthrough_eos(struct strmbase_passthrough *passthrough)
◆ sink_query_accept()
◆ sink_query_interface()
Definition at line 317 of file renderer.c.
318{
321
322 if (
filter->ops->renderer_pin_query_interface
325
328 else
330
333}
◆ strmbase_renderer_cleanup()
◆ strmbase_renderer_init()
Definition at line 584 of file renderer.c.
586{
590 ISeekingPassThru_Init(&
filter->passthrough.ISeekingPassThru_iface,
TRUE, &
filter->sink.pin.IPin_iface);
592
594
596
601}
static const IQualityControlVtbl quality_control_vtbl
static const struct strmbase_sink_ops sink_ops
static const struct strmbase_filter_ops filter_ops
void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator)
void strmbase_passthrough_init(struct strmbase_passthrough *passthrough, IUnknown *outer)
void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Referenced by null_renderer_create(), video_renderer_create(), vmr7_create(), and vmr9_create().
◆ WINE_DEFAULT_DEBUG_CHANNEL()
| WINE_DEFAULT_DEBUG_CHANNEL |
( |
quartz |
| ) |
|
◆ filter_ops
Initial value:=
{
}
static HRESULT renderer_start_stream(struct strmbase_filter *iface, REFERENCE_TIME start)
static HRESULT renderer_wait_state(struct strmbase_filter *iface, DWORD timeout)
static HRESULT renderer_stop_stream(struct strmbase_filter *iface)
static HRESULT renderer_query_interface(struct strmbase_filter *iface, REFIID iid, void **out)
static HRESULT renderer_init_stream(struct strmbase_filter *iface)
static HRESULT renderer_cleanup_stream(struct strmbase_filter *iface)
static struct strmbase_pin * renderer_get_pin(struct strmbase_filter *iface, unsigned int index)
static void renderer_destroy(struct strmbase_filter *iface)
Definition at line 299 of file renderer.c.
Referenced by strmbase_renderer_init().
◆ quality_control_vtbl
| const IQualityControlVtbl quality_control_vtbl |
|
static |
Initial value:=
{
}
static HRESULT WINAPI quality_control_QueryInterface(IQualityControl *iface, REFIID iid, void **out)
static HRESULT WINAPI quality_control_Notify(IQualityControl *iface, IBaseFilter *sender, Quality q)
static HRESULT WINAPI quality_control_SetSink(IQualityControl *iface, IQualityControl *sink)
static ULONG WINAPI quality_control_AddRef(IQualityControl *iface)
static ULONG WINAPI quality_control_Release(IQualityControl *iface)
Definition at line 559 of file renderer.c.
Referenced by strmbase_renderer_init().
◆ sink_ops
Initial value:=
{
}
static HRESULT sink_end_flush(struct strmbase_sink *iface)
static HRESULT sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static void sink_disconnect(struct strmbase_sink *iface)
static HRESULT sink_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt)
static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSample *sample)
static HRESULT sink_begin_flush(struct strmbase_sink *iface)
static HRESULT sink_eos(struct strmbase_sink *iface)
static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
Definition at line 489 of file renderer.c.
Referenced by strmbase_renderer_init().