Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/winegstreamer/media_source.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 5c502cf3ed5..7d677e39feb 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -64,6 +64,7 @@ struct media_stream enum source_async_op { SOURCE_ASYNC_START, + SOURCE_ASYNC_STOP, SOURCE_ASYNC_REQUEST_SAMPLE, };
@@ -343,6 +344,22 @@ static void start_pipeline(struct media_source *source, struct source_async_comm gst_element_set_state(source->container, GST_STATE_PLAYING); }
+static void stop_pipeline(struct media_source *source) +{ + gst_element_set_state(source->container, GST_STATE_PAUSED); + + for (unsigned int i = 0; i < source->stream_count; i++) + { + struct media_stream *stream = source->streams[i]; + if (stream->state != STREAM_INACTIVE) + IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamStopped, &GUID_NULL, S_OK, NULL); + } + + IMFMediaEventQueue_QueueEventParamVar(source->event_queue, MESourceStopped, &GUID_NULL, S_OK, NULL); + + source->state = SOURCE_STOPPED; +} + static void dispatch_end_of_presentation(struct media_source *source) { PROPVARIANT empty = {.vt = VT_EMPTY}; @@ -417,6 +434,9 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA case SOURCE_ASYNC_START: start_pipeline(source, command); break; + case SOURCE_ASYNC_STOP: + stop_pipeline(source); + break; case SOURCE_ASYNC_REQUEST_SAMPLE: wait_on_sample(command->u.request_sample.stream, command->u.request_sample.token); break; @@ -1087,13 +1107,18 @@ static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationD static HRESULT WINAPI media_source_Stop(IMFMediaSource *iface) { struct media_source *source = impl_from_IMFMediaSource(iface); + struct source_async_command *command; + HRESULT hr;
- FIXME("(%p): stub\n", source); + TRACE("(%p)\n", source);
if (source->state == SOURCE_SHUTDOWN) return MF_E_SHUTDOWN;
- return E_NOTIMPL; + if (SUCCEEDED(hr = source_create_async_op(SOURCE_ASYNC_STOP, &command))) + hr = MFPutWorkItem(source->async_commands_queue, &source->async_commands_callback, &command->IUnknown_iface); + + return hr; }
static HRESULT WINAPI media_source_Pause(IMFMediaSource *iface)
--- dlls/winegstreamer/mfplat.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 07dfae64f4f..50cd93b62d1 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -610,6 +610,7 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) unsigned int i;
IMFMediaType_SetUINT32(media_type, &MF_MT_COMPRESSED, FALSE); + IMFMediaType_SetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
/* First try FOURCC */ if ((fourcc_subtype.Data1 = gst_video_format_to_fourcc(video_info.finfo->format)))
Signed-off-by: Derek Leshodlesho@codeweavers.com
On 11/30/20 10:45 AM, Derek Lesho wrote:
dlls/winegstreamer/mfplat.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 07dfae64f4f..50cd93b62d1 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -610,6 +610,7 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) unsigned int i;
IMFMediaType_SetUINT32(media_type, &MF_MT_COMPRESSED, FALSE);
IMFMediaType_SetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE); /* First try FOURCC */ if ((fourcc_subtype.Data1 = gst_video_format_to_fourcc(video_info.finfo->format)))
The patch subject should probably specify "video".
On 11/30/20 10:45 AM, Derek Lesho wrote:
Signed-off-by: Derek Lesho dlesho@codeweavers.com
dlls/winegstreamer/media_source.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 5c502cf3ed5..7d677e39feb 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -64,6 +64,7 @@ struct media_stream enum source_async_op { SOURCE_ASYNC_START,
- SOURCE_ASYNC_STOP, SOURCE_ASYNC_REQUEST_SAMPLE,
};
@@ -343,6 +344,22 @@ static void start_pipeline(struct media_source *source, struct source_async_comm gst_element_set_state(source->container, GST_STATE_PLAYING); }
+static void stop_pipeline(struct media_source *source) +{
- gst_element_set_state(source->container, GST_STATE_PAUSED);
- for (unsigned int i = 0; i < source->stream_count; i++)
Another misplaced variable initializer here. Please try harder to watch for these.
- {
struct media_stream *stream = source->streams[i];
if (stream->state != STREAM_INACTIVE)
IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamStopped, &GUID_NULL, S_OK, NULL);
- }
- IMFMediaEventQueue_QueueEventParamVar(source->event_queue, MESourceStopped, &GUID_NULL, S_OK, NULL);
- source->state = SOURCE_STOPPED;
+}
static void dispatch_end_of_presentation(struct media_source *source) { PROPVARIANT empty = {.vt = VT_EMPTY}; @@ -417,6 +434,9 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA case SOURCE_ASYNC_START: start_pipeline(source, command); break;
case SOURCE_ASYNC_STOP:
stop_pipeline(source);
break; case SOURCE_ASYNC_REQUEST_SAMPLE: wait_on_sample(command->u.request_sample.stream, command->u.request_sample.token); break;
@@ -1087,13 +1107,18 @@ static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationD static HRESULT WINAPI media_source_Stop(IMFMediaSource *iface) { struct media_source *source = impl_from_IMFMediaSource(iface);
- struct source_async_command *command;
- HRESULT hr;
- FIXME("(%p): stub\n", source);
TRACE("(%p)\n", source);
if (source->state == SOURCE_SHUTDOWN) return MF_E_SHUTDOWN;
- return E_NOTIMPL;
- if (SUCCEEDED(hr = source_create_async_op(SOURCE_ASYNC_STOP, &command)))
hr = MFPutWorkItem(source->async_commands_queue, &source->async_commands_callback, &command->IUnknown_iface);
- return hr;
}
static HRESULT WINAPI media_source_Pause(IMFMediaSource *iface)
On 11/30/20 11:56 AM, Zebediah Figura (she/her) wrote:
On 11/30/20 10:45 AM, Derek Lesho wrote:
Signed-off-by: Derek Lesho dlesho@codeweavers.com
dlls/winegstreamer/media_source.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 5c502cf3ed5..7d677e39feb 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -64,6 +64,7 @@ struct media_stream enum source_async_op { SOURCE_ASYNC_START,
- SOURCE_ASYNC_STOP, SOURCE_ASYNC_REQUEST_SAMPLE, };
@@ -343,6 +344,22 @@ static void start_pipeline(struct media_source *source, struct source_async_comm gst_element_set_state(source->container, GST_STATE_PLAYING); }
+static void stop_pipeline(struct media_source *source) +{
- gst_element_set_state(source->container, GST_STATE_PAUSED);
- for (unsigned int i = 0; i < source->stream_count; i++)
Another misplaced variable initializer here. Please try harder to watch for these.
Whoops, sorry. It's muscle memory at this point for me to use this form, so I'll try to create a commit hook to avoid this in the future.
- {
struct media_stream *stream = source->streams[i];
if (stream->state != STREAM_INACTIVE)
IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamStopped, &GUID_NULL, S_OK, NULL);
- }
- IMFMediaEventQueue_QueueEventParamVar(source->event_queue, MESourceStopped, &GUID_NULL, S_OK, NULL);
- source->state = SOURCE_STOPPED;
+}
- static void dispatch_end_of_presentation(struct media_source *source) { PROPVARIANT empty = {.vt = VT_EMPTY};
@@ -417,6 +434,9 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA case SOURCE_ASYNC_START: start_pipeline(source, command); break;
case SOURCE_ASYNC_STOP:
stop_pipeline(source);
break; case SOURCE_ASYNC_REQUEST_SAMPLE: wait_on_sample(command->u.request_sample.stream, command->u.request_sample.token); break;
@@ -1087,13 +1107,18 @@ static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationD static HRESULT WINAPI media_source_Stop(IMFMediaSource *iface) { struct media_source *source = impl_from_IMFMediaSource(iface);
- struct source_async_command *command;
- HRESULT hr;
- FIXME("(%p): stub\n", source);
TRACE("(%p)\n", source);
if (source->state == SOURCE_SHUTDOWN) return MF_E_SHUTDOWN;
- return E_NOTIMPL;
if (SUCCEEDED(hr = source_create_async_op(SOURCE_ASYNC_STOP, &command)))
hr = MFPutWorkItem(source->async_commands_queue, &source->async_commands_callback, &command->IUnknown_iface);
return hr; }
static HRESULT WINAPI media_source_Pause(IMFMediaSource *iface)