annotate loader/dmo/DMO_AudioDecoder.c @ 10693:7cf006b5a61c

sync
author nauj27
date Mon, 25 Aug 2003 13:45:45 +0000
parents b0d1b415320c
children f70772d02eaa
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"
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
8 #ifndef NOAVIFILE_HEADERS
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
9 #include "audiodecoder.h"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
10 #include "except.h"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
11 #else
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
12 #include "libwin32.h"
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
13 #ifdef WIN32_LOADER
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
14 #include "ldt_keeper.h"
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
15 #endif
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
16 #endif
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
17
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
18 #include "DMO_Filter.h"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
19 #include "DMO_AudioDecoder.h"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
20
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
21 struct _DMO_AudioDecoder
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
22 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
23 DMO_MEDIA_TYPE m_sOurType, m_sDestType;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
24 DMO_Filter* m_pDMO_Filter;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
25 char* m_sVhdr;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
26 char* m_sVhdr2;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
27 int m_iFlushed;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
28 };
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
29
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
30 #include "DMO_AudioDecoder.h"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
31
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
32 #include <string.h>
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
33 #include <stdio.h>
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
34 #include <stdlib.h>
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
35
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
36 #define __MODULE__ "DirectShow audio decoder"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
37
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
38 typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**);
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
39 extern void print_wave_header(WAVEFORMATEX *h);
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
40
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
41 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
42 //DMO_AudioDecoder * DMO_AudioDecoder_Create(const CodecInfo * info, const WAVEFORMATEX* wf)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
43 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
44 DMO_AudioDecoder *this;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
45 int sz;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
46 WAVEFORMATEX* pWF;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
47
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
48 #ifdef WIN32_LOADER
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
49 Setup_LDT_Keeper();
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
50 Setup_FS_Segment();
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
51 #endif
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
52
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
53 this = malloc(sizeof(DMO_AudioDecoder));
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
54
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
55 this->m_iFlushed=1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
56
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
57 sz = 18 + wf->cbSize;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
58 this->m_sVhdr = malloc(sz);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
59 memcpy(this->m_sVhdr, wf, sz);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
60 this->m_sVhdr2 = malloc(18);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
61 memcpy(this->m_sVhdr2, this->m_sVhdr, 18);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
62
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
63 pWF = (WAVEFORMATEX*)this->m_sVhdr2;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
64 pWF->wFormatTag = 1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
65 pWF->wBitsPerSample = 16;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
66 pWF->nChannels = out_channels;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
67 pWF->nBlockAlign = 2*pWF->nChannels; //pWF->nChannels * (pWF->wBitsPerSample + 7) / 8;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
68 pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
69 pWF->cbSize = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
70
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
71 memset(&this->m_sOurType, 0, sizeof(this->m_sOurType));
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
72 this->m_sOurType.majortype=MEDIATYPE_Audio;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
73 this->m_sOurType.subtype=MEDIASUBTYPE_PCM;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
74 this->m_sOurType.subtype.f1=wf->wFormatTag;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
75 this->m_sOurType.formattype=FORMAT_WaveFormatEx;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
76 this->m_sOurType.lSampleSize=wf->nBlockAlign;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
77 this->m_sOurType.bFixedSizeSamples=1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
78 this->m_sOurType.bTemporalCompression=0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
79 this->m_sOurType.cbFormat=sz;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
80 this->m_sOurType.pbFormat=this->m_sVhdr;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
81
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
82 memset(&this->m_sDestType, 0, sizeof(this->m_sDestType));
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
83 this->m_sDestType.majortype=MEDIATYPE_Audio;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
84 this->m_sDestType.subtype=MEDIASUBTYPE_PCM;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
85 this->m_sDestType.formattype=FORMAT_WaveFormatEx;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
86 this->m_sDestType.bFixedSizeSamples=1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
87 this->m_sDestType.bTemporalCompression=0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
88 this->m_sDestType.lSampleSize=pWF->nBlockAlign;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
89 this->m_sDestType.cbFormat=18; //pWF->cbSize;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
90 this->m_sDestType.pbFormat=this->m_sVhdr2;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
91
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
92 print_wave_header((WAVEFORMATEX *)this->m_sVhdr);
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
93 print_wave_header((WAVEFORMATEX *)this->m_sVhdr2);
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
94
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
95 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
96 if( !this->m_pDMO_Filter ) {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
97 free(this);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
98 return NULL;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
99 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
100
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
101 return this;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
102 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
103
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
104 void DMO_AudioDecoder_Destroy(DMO_AudioDecoder *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 free(this->m_sVhdr);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
107 free(this->m_sVhdr2);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
108 DMO_Filter_Destroy(this->m_pDMO_Filter);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
109 free(this);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
110 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
111
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
112 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
113 void* out_data, unsigned int out_size,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
114 unsigned int* size_read, unsigned int* size_written)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
115 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
116 DMO_OUTPUT_DATA_BUFFER db;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
117 CMediaBuffer* bufferin;
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
118 unsigned long written = 0;
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
119 unsigned long read = 0;
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
120 int r = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
121
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
122 if (!in_data || !out_data)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
123 return -1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
124
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
125 #ifdef WIN32_LOADER
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
126 Setup_FS_Segment();
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
127 #endif
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
128
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
129 //m_pDMO_Filter->m_pMedia->vt->Lock(m_pDMO_Filter->m_pMedia, 1);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
130 bufferin = CMediaBufferCreate(in_size, (void*)in_data, in_size, 1);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
131 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
132 (IMediaBuffer*)bufferin,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
133 (this->m_iFlushed) ? DMO_INPUT_DATA_BUFFERF_SYNCPOINT : 0,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
134 0, 0);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
135 if (r == 0){
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
136 ((IMediaBuffer*)bufferin)->vt->GetBufferAndLength((IMediaBuffer*)bufferin, 0, &read);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
137 this->m_iFlushed = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
138 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
139
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
140 ((IMediaBuffer*)bufferin)->vt->Release((IUnknown*)bufferin);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
141
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
142 //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
143 if (r == 0 || (unsigned)r == DMO_E_NOTACCEPTING){
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
144 unsigned long status = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
145 /* something for process */
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
146 db.rtTimestamp = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
147 db.rtTimelength = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
148 db.dwStatus = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
149 db.pBuffer = (IMediaBuffer*) CMediaBufferCreate(out_size, out_data, 0, 0);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
150 //printf("OUTSIZE %d\n", out_size);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
151 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
152 0, 1, &db, &status);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
153
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
154 ((IMediaBuffer*)db.pBuffer)->vt->GetBufferAndLength((IMediaBuffer*)db.pBuffer, 0, &written);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
155 ((IMediaBuffer*)db.pBuffer)->vt->Release((IUnknown*)db.pBuffer);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
156
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
157 //printf("RESULTB: %d 0x%x %ld\n", r, r, written);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
158 //printf("Converted %d -> %d\n", in_size, out_size);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
159 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
160 else if (in_size > 0)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
161 printf("ProcessInputError r:0x%x=%d\n", r, r);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
162
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
163 if (size_read)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
164 *size_read = read;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
165 if (size_written)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
166 *size_written = written;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
167 return r;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
168 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
169
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
170 int DMO_AudioDecoder_GetSrcSize(DMO_AudioDecoder *this, int dest_size)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
171 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
172 // unsigned long inputs, outputs;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
173 // Setup_FS_Segment();
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
174 // 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
175 return ((WAVEFORMATEX*)this->m_sVhdr)->nBlockAlign*4;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
176 }