Commit 437d304c authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Rename struct h264_decoder to struct video_decoder.

parent ae584ac6
...@@ -218,10 +218,10 @@ P: Zebediah Figura <z.figura12@gmail.com> ...@@ -218,10 +218,10 @@ P: Zebediah Figura <z.figura12@gmail.com>
F: dlls/mf/tests/transform.c F: dlls/mf/tests/transform.c
F: dlls/winegstreamer/aac_decoder.c F: dlls/winegstreamer/aac_decoder.c
F: dlls/winegstreamer/color_convert.c F: dlls/winegstreamer/color_convert.c
F: dlls/winegstreamer/h264_decoder.c
F: dlls/winegstreamer/media_source.c F: dlls/winegstreamer/media_source.c
F: dlls/winegstreamer/mfplat.c F: dlls/winegstreamer/mfplat.c
F: dlls/winegstreamer/resampler.c F: dlls/winegstreamer/resampler.c
F: dlls/winegstreamer/video_decoder.c
F: dlls/winegstreamer/video_processor.c F: dlls/winegstreamer/video_processor.c
F: dlls/winegstreamer/wg_sample.c F: dlls/winegstreamer/wg_sample.c
F: dlls/winegstreamer/wg_transform.c F: dlls/winegstreamer/wg_transform.c
......
...@@ -9,7 +9,6 @@ UNIX_LIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS) ...@@ -9,7 +9,6 @@ UNIX_LIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS)
SOURCES = \ SOURCES = \
aac_decoder.c \ aac_decoder.c \
color_convert.c \ color_convert.c \
h264_decoder.c \
main.c \ main.c \
media_sink.c \ media_sink.c \
media_source.c \ media_source.c \
...@@ -19,6 +18,7 @@ SOURCES = \ ...@@ -19,6 +18,7 @@ SOURCES = \
resampler.c \ resampler.c \
rsrc.rc \ rsrc.rc \
unixlib.c \ unixlib.c \
video_decoder.c \
video_processor.c \ video_processor.c \
wg_allocator.c \ wg_allocator.c \
wg_format.c \ wg_format.c \
......
...@@ -43,7 +43,7 @@ static const GUID *const video_decoder_output_types[] = ...@@ -43,7 +43,7 @@ static const GUID *const video_decoder_output_types[] =
&MFVideoFormat_YUY2, &MFVideoFormat_YUY2,
}; };
struct h264_decoder struct video_decoder
{ {
IMFTransform IMFTransform_iface; IMFTransform IMFTransform_iface;
LONG refcount; LONG refcount;
...@@ -72,12 +72,12 @@ struct h264_decoder ...@@ -72,12 +72,12 @@ struct h264_decoder
IMFMediaBuffer *temp_buffer; IMFMediaBuffer *temp_buffer;
}; };
static struct h264_decoder *impl_from_IMFTransform(IMFTransform *iface) static struct video_decoder *impl_from_IMFTransform(IMFTransform *iface)
{ {
return CONTAINING_RECORD(iface, struct h264_decoder, IMFTransform_iface); return CONTAINING_RECORD(iface, struct video_decoder, IMFTransform_iface);
} }
static HRESULT try_create_wg_transform(struct h264_decoder *decoder) static HRESULT try_create_wg_transform(struct video_decoder *decoder)
{ {
/* Call of Duty: Black Ops 3 doesn't care about the ProcessInput/ProcessOutput /* Call of Duty: Black Ops 3 doesn't care about the ProcessInput/ProcessOutput
* return values, it calls them in a specific order and expects the decoder * return values, it calls them in a specific order and expects the decoder
...@@ -118,7 +118,7 @@ static HRESULT try_create_wg_transform(struct h264_decoder *decoder) ...@@ -118,7 +118,7 @@ static HRESULT try_create_wg_transform(struct h264_decoder *decoder)
return S_OK; return S_OK;
} }
static HRESULT create_output_media_type(struct h264_decoder *decoder, const GUID *subtype, static HRESULT create_output_media_type(struct video_decoder *decoder, const GUID *subtype,
IMFMediaType *output_type, IMFMediaType **media_type) IMFMediaType *output_type, IMFMediaType **media_type)
{ {
IMFMediaType *default_type = decoder->output_type, *stream_type = output_type ? output_type : decoder->stream_type; IMFMediaType *default_type = decoder->output_type, *stream_type = output_type ? output_type : decoder->stream_type;
...@@ -198,7 +198,7 @@ done: ...@@ -198,7 +198,7 @@ done:
return hr; return hr;
} }
static HRESULT init_allocator(struct h264_decoder *decoder) static HRESULT init_allocator(struct video_decoder *decoder)
{ {
HRESULT hr; HRESULT hr;
...@@ -217,7 +217,7 @@ static HRESULT init_allocator(struct h264_decoder *decoder) ...@@ -217,7 +217,7 @@ static HRESULT init_allocator(struct h264_decoder *decoder)
return S_OK; return S_OK;
} }
static void uninit_allocator(struct h264_decoder *decoder) static void uninit_allocator(struct video_decoder *decoder)
{ {
IMFVideoSampleAllocatorEx_UninitializeSampleAllocator(decoder->allocator); IMFVideoSampleAllocatorEx_UninitializeSampleAllocator(decoder->allocator);
decoder->allocator_initialized = FALSE; decoder->allocator_initialized = FALSE;
...@@ -225,7 +225,7 @@ static void uninit_allocator(struct h264_decoder *decoder) ...@@ -225,7 +225,7 @@ static void uninit_allocator(struct h264_decoder *decoder)
static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, void **out) static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, void **out)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
...@@ -245,7 +245,7 @@ static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, ...@@ -245,7 +245,7 @@ static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid,
static ULONG WINAPI transform_AddRef(IMFTransform *iface) static ULONG WINAPI transform_AddRef(IMFTransform *iface)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
ULONG refcount = InterlockedIncrement(&decoder->refcount); ULONG refcount = InterlockedIncrement(&decoder->refcount);
TRACE("iface %p increasing refcount to %lu.\n", decoder, refcount); TRACE("iface %p increasing refcount to %lu.\n", decoder, refcount);
...@@ -255,7 +255,7 @@ static ULONG WINAPI transform_AddRef(IMFTransform *iface) ...@@ -255,7 +255,7 @@ static ULONG WINAPI transform_AddRef(IMFTransform *iface)
static ULONG WINAPI transform_Release(IMFTransform *iface) static ULONG WINAPI transform_Release(IMFTransform *iface)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
ULONG refcount = InterlockedDecrement(&decoder->refcount); ULONG refcount = InterlockedDecrement(&decoder->refcount);
TRACE("iface %p decreasing refcount to %lu.\n", decoder, refcount); TRACE("iface %p decreasing refcount to %lu.\n", decoder, refcount);
...@@ -309,7 +309,7 @@ static HRESULT WINAPI transform_GetStreamIDs(IMFTransform *iface, DWORD input_si ...@@ -309,7 +309,7 @@ static HRESULT WINAPI transform_GetStreamIDs(IMFTransform *iface, DWORD input_si
static HRESULT WINAPI transform_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info) static HRESULT WINAPI transform_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); TRACE("iface %p, id %#lx, info %p.\n", iface, id, info);
...@@ -319,7 +319,7 @@ static HRESULT WINAPI transform_GetInputStreamInfo(IMFTransform *iface, DWORD id ...@@ -319,7 +319,7 @@ static HRESULT WINAPI transform_GetInputStreamInfo(IMFTransform *iface, DWORD id
static HRESULT WINAPI transform_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info) static HRESULT WINAPI transform_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); TRACE("iface %p, id %#lx, info %p.\n", iface, id, info);
...@@ -329,7 +329,7 @@ static HRESULT WINAPI transform_GetOutputStreamInfo(IMFTransform *iface, DWORD i ...@@ -329,7 +329,7 @@ static HRESULT WINAPI transform_GetOutputStreamInfo(IMFTransform *iface, DWORD i
static HRESULT WINAPI transform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes) static HRESULT WINAPI transform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
FIXME("iface %p, attributes %p semi-stub!\n", iface, attributes); FIXME("iface %p, attributes %p semi-stub!\n", iface, attributes);
...@@ -348,7 +348,7 @@ static HRESULT WINAPI transform_GetInputStreamAttributes(IMFTransform *iface, DW ...@@ -348,7 +348,7 @@ static HRESULT WINAPI transform_GetInputStreamAttributes(IMFTransform *iface, DW
static HRESULT WINAPI transform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) static HRESULT WINAPI transform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
FIXME("iface %p, id %#lx, attributes %p semi-stub!\n", iface, id, attributes); FIXME("iface %p, id %#lx, attributes %p semi-stub!\n", iface, id, attributes);
...@@ -376,7 +376,7 @@ static HRESULT WINAPI transform_AddInputStreams(IMFTransform *iface, DWORD strea ...@@ -376,7 +376,7 @@ static HRESULT WINAPI transform_AddInputStreams(IMFTransform *iface, DWORD strea
static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
IMFMediaType **type) IMFMediaType **type)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type);
...@@ -389,7 +389,7 @@ static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD ...@@ -389,7 +389,7 @@ static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD
static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWORD id, static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWORD id,
DWORD index, IMFMediaType **type) DWORD index, IMFMediaType **type)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type);
...@@ -401,7 +401,7 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR ...@@ -401,7 +401,7 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR
return create_output_media_type(decoder, decoder->output_types[index], NULL, type); return create_output_media_type(decoder, decoder->output_types[index], NULL, type);
} }
static HRESULT update_output_info_size(struct h264_decoder *decoder, UINT32 width, UINT32 height) static HRESULT update_output_info_size(struct video_decoder *decoder, UINT32 width, UINT32 height)
{ {
HRESULT hr = E_FAIL; HRESULT hr = E_FAIL;
UINT32 i, size; UINT32 i, size;
...@@ -420,7 +420,7 @@ static HRESULT update_output_info_size(struct h264_decoder *decoder, UINT32 widt ...@@ -420,7 +420,7 @@ static HRESULT update_output_info_size(struct h264_decoder *decoder, UINT32 widt
static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
GUID major, subtype; GUID major, subtype;
UINT64 frame_size; UINT64 frame_size;
HRESULT hr; HRESULT hr;
...@@ -465,7 +465,7 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM ...@@ -465,7 +465,7 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM
static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
UINT64 frame_size, stream_frame_size; UINT64 frame_size, stream_frame_size;
GUID major, subtype; GUID major, subtype;
HRESULT hr; HRESULT hr;
...@@ -525,7 +525,7 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF ...@@ -525,7 +525,7 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
HRESULT hr; HRESULT hr;
TRACE("iface %p, id %#lx, type %p\n", iface, id, type); TRACE("iface %p, id %#lx, type %p\n", iface, id, type);
...@@ -541,7 +541,7 @@ static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD i ...@@ -541,7 +541,7 @@ static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD i
static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
GUID subtype; GUID subtype;
HRESULT hr; HRESULT hr;
...@@ -556,7 +556,7 @@ static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD ...@@ -556,7 +556,7 @@ static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD
static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
TRACE("iface %p, id %#lx, flags %p.\n", iface, id, flags); TRACE("iface %p, id %#lx, flags %p.\n", iface, id, flags);
...@@ -587,7 +587,7 @@ static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFM ...@@ -587,7 +587,7 @@ static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFM
static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
HRESULT hr; HRESULT hr;
TRACE("iface %p, message %#x, param %Ix.\n", iface, message, param); TRACE("iface %p, message %#x, param %Ix.\n", iface, message, param);
...@@ -619,7 +619,7 @@ static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_ ...@@ -619,7 +619,7 @@ static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_
static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags); TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags);
...@@ -629,7 +629,7 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS ...@@ -629,7 +629,7 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS
return wg_transform_push_mf(decoder->wg_transform, sample, decoder->wg_sample_queue); return wg_transform_push_mf(decoder->wg_transform, sample, decoder->wg_sample_queue);
} }
static HRESULT output_sample(struct h264_decoder *decoder, IMFSample **out, IMFSample *src_sample) static HRESULT output_sample(struct video_decoder *decoder, IMFSample **out, IMFSample *src_sample)
{ {
MFT_OUTPUT_DATA_BUFFER output[1]; MFT_OUTPUT_DATA_BUFFER output[1];
IMFSample *sample; IMFSample *sample;
...@@ -659,7 +659,7 @@ static HRESULT output_sample(struct h264_decoder *decoder, IMFSample **out, IMFS ...@@ -659,7 +659,7 @@ static HRESULT output_sample(struct h264_decoder *decoder, IMFSample **out, IMFS
return S_OK; return S_OK;
} }
static HRESULT handle_stream_type_change(struct h264_decoder *decoder, const struct wg_format *format) static HRESULT handle_stream_type_change(struct video_decoder *decoder, const struct wg_format *format)
{ {
UINT64 frame_size, frame_rate; UINT64 frame_size, frame_rate;
HRESULT hr; HRESULT hr;
...@@ -685,7 +685,7 @@ static HRESULT handle_stream_type_change(struct h264_decoder *decoder, const str ...@@ -685,7 +685,7 @@ static HRESULT handle_stream_type_change(struct h264_decoder *decoder, const str
static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status) MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status)
{ {
struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct video_decoder *decoder = impl_from_IMFTransform(iface);
struct wg_format wg_format; struct wg_format wg_format;
UINT32 sample_size; UINT32 sample_size;
LONGLONG duration; LONGLONG duration;
...@@ -801,7 +801,7 @@ static const IMFTransformVtbl transform_vtbl = ...@@ -801,7 +801,7 @@ static const IMFTransformVtbl transform_vtbl =
static HRESULT video_decoder_create_with_types(const GUID *const *input_types, UINT input_type_count, static HRESULT video_decoder_create_with_types(const GUID *const *input_types, UINT input_type_count,
const GUID *const *output_types, UINT output_type_count, IMFTransform **ret) const GUID *const *output_types, UINT output_type_count, IMFTransform **ret)
{ {
struct h264_decoder *decoder; struct video_decoder *decoder;
HRESULT hr; HRESULT hr;
if (!(decoder = calloc(1, sizeof(*decoder)))) if (!(decoder = calloc(1, sizeof(*decoder))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment