summaryrefslogtreecommitdiffstats
path: root/Src/mp4v/MFTDecoder.h
blob: 997b24a9d93c35bc8fa1f293a851bd9d9c7f2bd9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once
#include <Mftransform.h>
#include <bfc/platform/types.h>
#include "../Winamp/wa_ipc.h"
#include <Amvideo.h>

class MFTDecoder
{
public:
	MFTDecoder();
	~MFTDecoder();
	
	HRESULT Open(VIDEOINFOHEADER *header);
	HRESULT Feed(const void *data, size_t data_size, uint64_t timestamp_hundred_nanos);
	HRESULT GetFrame(IMFMediaBuffer **output_buffer, uint64_t *hundrednanos);
	HRESULT GetFrame(YV12_PLANES **data, void **decoder_data, uint64_t *mft_timestamp);
	HRESULT FreeFrame(YV12_PLANES *data, void *decoder_data);
	HRESULT GetOutputFormat(UINT *width, UINT *height, bool *flip, double *aspect);
	HRESULT Flush();
	HRESULT Drain();

	IMFTransform *decoder;
	LONG stride;
	UINT32 width, height;
};