annotate loader/dmo/DMO_AudioDecoder.c @ 18715:30d7ddf08889

Fix window position when changing videos while in fullscreen and for window managers that modify position on Map. Oked by Alexander Strasser.
author reimar
date Thu, 15 Jun 2006 08:00:37 +0000
parents d026c9bb2938
children 2934974c366a
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
17978
d026c9bb2938 include MSGL_* definitions
henry
parents: 17977
diff changeset
36 #include "../../mp_msg.h"
d026c9bb2938 include MSGL_* definitions
henry
parents: 17977
diff changeset
37
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
38 #define __MODULE__ "DirectShow audio decoder"
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
39
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
40 typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**);
17977
f70772d02eaa Convert printfs in aviprint.c to mp_msg and give the information printing
diego
parents: 9967
diff changeset
41 extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
42
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
43 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
44 //DMO_AudioDecoder * DMO_AudioDecoder_Create(const CodecInfo * info, const WAVEFORMATEX* wf)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
45 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
46 DMO_AudioDecoder *this;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
47 int sz;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
48 WAVEFORMATEX* pWF;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
49
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
50 #ifdef WIN32_LOADER
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
51 Setup_LDT_Keeper();
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
52 Setup_FS_Segment();
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
53 #endif
8325
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 = malloc(sizeof(DMO_AudioDecoder));
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
56
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
57 this->m_iFlushed=1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
58
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
59 sz = 18 + wf->cbSize;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
60 this->m_sVhdr = malloc(sz);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
61 memcpy(this->m_sVhdr, wf, sz);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
62 this->m_sVhdr2 = malloc(18);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
63 memcpy(this->m_sVhdr2, this->m_sVhdr, 18);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
64
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
65 pWF = (WAVEFORMATEX*)this->m_sVhdr2;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
66 pWF->wFormatTag = 1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
67 pWF->wBitsPerSample = 16;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
68 pWF->nChannels = out_channels;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
69 pWF->nBlockAlign = 2*pWF->nChannels; //pWF->nChannels * (pWF->wBitsPerSample + 7) / 8;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
70 pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
71 pWF->cbSize = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
72
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
73 memset(&this->m_sOurType, 0, sizeof(this->m_sOurType));
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
74 this->m_sOurType.majortype=MEDIATYPE_Audio;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
75 this->m_sOurType.subtype=MEDIASUBTYPE_PCM;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
76 this->m_sOurType.subtype.f1=wf->wFormatTag;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
77 this->m_sOurType.formattype=FORMAT_WaveFormatEx;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
78 this->m_sOurType.lSampleSize=wf->nBlockAlign;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
79 this->m_sOurType.bFixedSizeSamples=1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
80 this->m_sOurType.bTemporalCompression=0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
81 this->m_sOurType.cbFormat=sz;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
82 this->m_sOurType.pbFormat=this->m_sVhdr;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
83
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
84 memset(&this->m_sDestType, 0, sizeof(this->m_sDestType));
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
85 this->m_sDestType.majortype=MEDIATYPE_Audio;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
86 this->m_sDestType.subtype=MEDIASUBTYPE_PCM;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
87 this->m_sDestType.formattype=FORMAT_WaveFormatEx;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
88 this->m_sDestType.bFixedSizeSamples=1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
89 this->m_sDestType.bTemporalCompression=0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
90 this->m_sDestType.lSampleSize=pWF->nBlockAlign;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
91 this->m_sDestType.cbFormat=18; //pWF->cbSize;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
92 this->m_sDestType.pbFormat=this->m_sVhdr2;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
93
17977
f70772d02eaa Convert printfs in aviprint.c to mp_msg and give the information printing
diego
parents: 9967
diff changeset
94 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
95 print_wave_header((WAVEFORMATEX *)this->m_sVhdr2, MSGL_V);
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
96
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
97 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
98 if( !this->m_pDMO_Filter ) {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
99 free(this);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
100 return NULL;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
101 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
102
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
103 return this;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
104 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
105
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
106 void DMO_AudioDecoder_Destroy(DMO_AudioDecoder *this)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
107 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
108 free(this->m_sVhdr);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
109 free(this->m_sVhdr2);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
110 DMO_Filter_Destroy(this->m_pDMO_Filter);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
111 free(this);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
112 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
113
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
114 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
115 void* out_data, unsigned int out_size,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
116 unsigned int* size_read, unsigned int* size_written)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
117 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
118 DMO_OUTPUT_DATA_BUFFER db;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
119 CMediaBuffer* bufferin;
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
120 unsigned long written = 0;
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8325
diff changeset
121 unsigned long read = 0;
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
122 int r = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
123
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
124 if (!in_data || !out_data)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
125 return -1;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
126
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
127 #ifdef WIN32_LOADER
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
128 Setup_FS_Segment();
9967
b0d1b415320c cygwin support patch by Sascha Sommer and some fixes by me
alex
parents: 8451
diff changeset
129 #endif
8325
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
130
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
131 //m_pDMO_Filter->m_pMedia->vt->Lock(m_pDMO_Filter->m_pMedia, 1);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
132 bufferin = CMediaBufferCreate(in_size, (void*)in_data, in_size, 1);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
133 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
134 (IMediaBuffer*)bufferin,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
135 (this->m_iFlushed) ? DMO_INPUT_DATA_BUFFERF_SYNCPOINT : 0,
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
136 0, 0);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
137 if (r == 0){
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
138 ((IMediaBuffer*)bufferin)->vt->GetBufferAndLength((IMediaBuffer*)bufferin, 0, &read);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
139 this->m_iFlushed = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
140 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
141
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
142 ((IMediaBuffer*)bufferin)->vt->Release((IUnknown*)bufferin);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
143
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
144 //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
145 if (r == 0 || (unsigned)r == DMO_E_NOTACCEPTING){
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
146 unsigned long status = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
147 /* something for process */
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
148 db.rtTimestamp = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
149 db.rtTimelength = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
150 db.dwStatus = 0;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
151 db.pBuffer = (IMediaBuffer*) CMediaBufferCreate(out_size, out_data, 0, 0);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
152 //printf("OUTSIZE %d\n", out_size);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
153 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
154 0, 1, &db, &status);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
155
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
156 ((IMediaBuffer*)db.pBuffer)->vt->GetBufferAndLength((IMediaBuffer*)db.pBuffer, 0, &written);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
157 ((IMediaBuffer*)db.pBuffer)->vt->Release((IUnknown*)db.pBuffer);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
158
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
159 //printf("RESULTB: %d 0x%x %ld\n", r, r, written);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
160 //printf("Converted %d -> %d\n", in_size, out_size);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
161 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
162 else if (in_size > 0)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
163 printf("ProcessInputError r:0x%x=%d\n", r, r);
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
164
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
165 if (size_read)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
166 *size_read = read;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
167 if (size_written)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
168 *size_written = written;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
169 return r;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
170 }
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
171
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
172 int DMO_AudioDecoder_GetSrcSize(DMO_AudioDecoder *this, int dest_size)
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
173 {
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
174 // unsigned long inputs, outputs;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
175 // Setup_FS_Segment();
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
176 // 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
177 return ((WAVEFORMATEX*)this->m_sVhdr)->nBlockAlign*4;
5d5d1b3ec737 DMO Audio support (ugly, needs cleanup)
arpi
parents:
diff changeset
178 }