annotate loader/dmo/DMO_AudioDecoder.c @ 30746:7092b8fc23f4

Add cddb:// support for OS/2
author komh
date Sun, 28 Feb 2010 03:26:18 +0000
parents 15a0ece27006
children 5b78a5e38218
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
1 /********************************************************
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
2
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
3 DirectShow audio decoder
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
4 Copyright 2001 Eugene Kuznetsov (divx@euro.ru)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
5
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
6 *********************************************************/
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
7 #include "config.h"
30170
008338d7679f Drop -Iloader from CPPFLAGS for the loader subdirectory.
diego
parents: 29263
diff changeset
8 #include "loader/dshow/libwin32.h"
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
9 #ifdef WIN32_LOADER
30170
008338d7679f Drop -Iloader from CPPFLAGS for the loader subdirectory.
diego
parents: 29263
diff changeset
10 #include "loader/ldt_keeper.h"
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
11 #endif
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
12
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
13 #include "DMO_Filter.h"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
14 #include "DMO_AudioDecoder.h"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
15
25794
2c8cdb9123b8 Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents: 23429
diff changeset
16 struct DMO_AudioDecoder
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
17 {
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
18 DMO_MEDIA_TYPE m_sOurType, m_sDestType;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
19 DMO_Filter* m_pDMO_Filter;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
20 char* m_sVhdr;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
21 char* m_sVhdr2;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
22 int m_iFlushed;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
23 };
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
24
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
25 #include "DMO_AudioDecoder.h"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
26
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
27 #include <string.h>
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
28 #include <stdio.h>
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
29 #include <stdlib.h>
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
30
26544
f20a11161e62 Use consistent #include paths without "../".
diego
parents: 25794
diff changeset
31 #include "mp_msg.h"
30594
15a0ece27006 Add header #include for print_wave_header() instead of a forward declaration.
diego
parents: 30170
diff changeset
32 #include "libmpdemux/aviprint.h"
17978
d026c9bb2938 include MSGL_* definitions
henry
parents: 17977
diff changeset
33
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
34 typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
35
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
36 DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf,int out_channels)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
37 //DMO_AudioDecoder * DMO_AudioDecoder_Create(const CodecInfo * info, const WAVEFORMATEX* wf)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
38 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
39 DMO_AudioDecoder *this;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
40 int sz;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
41 WAVEFORMATEX* pWF;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
42
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
43 #ifdef WIN32_LOADER
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
44 Setup_LDT_Keeper();
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
45 Setup_FS_Segment();
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
46 #endif
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
47
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
48 this = malloc(sizeof(DMO_AudioDecoder));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
49
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
50 this->m_iFlushed=1;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
51
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
52 sz = 18 + wf->cbSize;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
53 this->m_sVhdr = malloc(sz);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
54 memcpy(this->m_sVhdr, wf, sz);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
55 this->m_sVhdr2 = malloc(18);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
56 memcpy(this->m_sVhdr2, this->m_sVhdr, 18);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
57
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
58 pWF = (WAVEFORMATEX*)this->m_sVhdr2;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
59 pWF->wFormatTag = 1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
60 pWF->wBitsPerSample = 16;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
61 pWF->nChannels = out_channels;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
62 pWF->nBlockAlign = 2*pWF->nChannels; //pWF->nChannels * (pWF->wBitsPerSample + 7) / 8;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
63 pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
64 pWF->cbSize = 0;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
65
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
66 memset(&this->m_sOurType, 0, sizeof(this->m_sOurType));
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
67 this->m_sOurType.majortype=MEDIATYPE_Audio;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
68 this->m_sOurType.subtype=MEDIASUBTYPE_PCM;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
69 this->m_sOurType.subtype.f1=wf->wFormatTag;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
70 this->m_sOurType.formattype=FORMAT_WaveFormatEx;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
71 this->m_sOurType.lSampleSize=wf->nBlockAlign;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
72 this->m_sOurType.bFixedSizeSamples=1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
73 this->m_sOurType.bTemporalCompression=0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
74 this->m_sOurType.cbFormat=sz;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
75 this->m_sOurType.pbFormat=this->m_sVhdr;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
76
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
77 memset(&this->m_sDestType, 0, sizeof(this->m_sDestType));
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
78 this->m_sDestType.majortype=MEDIATYPE_Audio;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
79 this->m_sDestType.subtype=MEDIASUBTYPE_PCM;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
80 this->m_sDestType.formattype=FORMAT_WaveFormatEx;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
81 this->m_sDestType.bFixedSizeSamples=1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
82 this->m_sDestType.bTemporalCompression=0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
83 this->m_sDestType.lSampleSize=pWF->nBlockAlign;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
84 this->m_sDestType.cbFormat=18; //pWF->cbSize;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
85 this->m_sDestType.pbFormat=this->m_sVhdr2;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
86
17977
f70772d02eaa Convert printfs in aviprint.c to mp_msg and give the information printing
diego
parents: 9967
diff changeset
87 print_wave_header((WAVEFORMATEX *)this->m_sVhdr, MSGL_V);
f70772d02eaa Convert printfs in aviprint.c to mp_msg and give the information printing
diego
parents: 9967
diff changeset
88 print_wave_header((WAVEFORMATEX *)this->m_sVhdr2, MSGL_V);
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
89
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
90 this->m_pDMO_Filter = DMO_FilterCreate(dllname, guid, &this->m_sOurType, &this->m_sDestType);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
91 if( !this->m_pDMO_Filter ) {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
92 free(this);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
93 return NULL;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
94 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
95
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
96 return this;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
97 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
98
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
99 void DMO_AudioDecoder_Destroy(DMO_AudioDecoder *this)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
100 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
101 free(this->m_sVhdr);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
102 free(this->m_sVhdr2);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
103 DMO_Filter_Destroy(this->m_pDMO_Filter);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
104 free(this);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
105 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
106
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
107 int DMO_AudioDecoder_Convert(DMO_AudioDecoder *this, const void* in_data, unsigned int in_size,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
108 void* out_data, unsigned int out_size,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
109 unsigned int* size_read, unsigned int* size_written)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
110 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
111 DMO_OUTPUT_DATA_BUFFER db;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
112 CMediaBuffer* bufferin;
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
113 unsigned long written = 0;
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
114 unsigned long read = 0;
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
115 int r = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
116
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
117 if (!in_data || !out_data)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
118 return -1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
119
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
120 #ifdef WIN32_LOADER
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
121 Setup_FS_Segment();
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
122 #endif
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
123
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
124 //m_pDMO_Filter->m_pMedia->vt->Lock(m_pDMO_Filter->m_pMedia, 1);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
125 bufferin = CMediaBufferCreate(in_size, (void*)in_data, in_size, 1);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
126 r = this->m_pDMO_Filter->m_pMedia->vt->ProcessInput(this->m_pDMO_Filter->m_pMedia, 0,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
127 (IMediaBuffer*)bufferin,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
128 (this->m_iFlushed) ? DMO_INPUT_DATA_BUFFERF_SYNCPOINT : 0,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
129 0, 0);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
130 if (r == 0){
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
131 ((IMediaBuffer*)bufferin)->vt->GetBufferAndLength((IMediaBuffer*)bufferin, 0, &read);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
132 this->m_iFlushed = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
133 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
134
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
135 ((IMediaBuffer*)bufferin)->vt->Release((IUnknown*)bufferin);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
136
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
137 //printf("RESULTA: %d 0x%x %ld %d %d\n", r, r, read, m_iFlushed, out_size);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
138 if (r == 0 || (unsigned)r == DMO_E_NOTACCEPTING){
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
139 unsigned long status = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
140 /* something for process */
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
141 db.rtTimestamp = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
142 db.rtTimelength = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
143 db.dwStatus = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
144 db.pBuffer = (IMediaBuffer*) CMediaBufferCreate(out_size, out_data, 0, 0);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
145 //printf("OUTSIZE %d\n", out_size);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
146 r = this->m_pDMO_Filter->m_pMedia->vt->ProcessOutput(this->m_pDMO_Filter->m_pMedia,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
147 0, 1, &db, &status);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
148
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
149 ((IMediaBuffer*)db.pBuffer)->vt->GetBufferAndLength((IMediaBuffer*)db.pBuffer, 0, &written);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
150 ((IMediaBuffer*)db.pBuffer)->vt->Release((IUnknown*)db.pBuffer);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
151
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
152 //printf("RESULTB: %d 0x%x %ld\n", r, r, written);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
153 //printf("Converted %d -> %d\n", in_size, out_size);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
154 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
155 else if (in_size > 0)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
156 printf("ProcessInputError r:0x%x=%d\n", r, r);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
157
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
158 if (size_read)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
159 *size_read = read;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
160 if (size_written)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
161 *size_written = written;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
162 return r;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
163 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
164
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
165 int DMO_AudioDecoder_GetSrcSize(DMO_AudioDecoder *this, int dest_size)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
166 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
167 // unsigned long inputs, outputs;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
168 // Setup_FS_Segment();
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
169 // this->m_pDMO_Filter->m_pMedia->vt->GetOutputSizeInfo(this->m_pDMO_Filter->m_pMedia, 0, &inputs, &outputs);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
170 return ((WAVEFORMATEX*)this->m_sVhdr)->nBlockAlign*4;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
171 }