34 namespace DS9 |
34 namespace DS9 |
35 { |
35 { |
36 //these mediatypes define a stream, its type will be autodetected by DirectShow |
36 //these mediatypes define a stream, its type will be autodetected by DirectShow |
37 static QVector<AM_MEDIA_TYPE> getMediaTypes() |
37 static QVector<AM_MEDIA_TYPE> getMediaTypes() |
38 { |
38 { |
39 AM_MEDIA_TYPE mt = { MEDIATYPE_Stream, MEDIASUBTYPE_NULL, TRUE, FALSE, 1, GUID_NULL, 0, 0, 0}; |
39 //the order here is important because otherwise, |
|
40 //directshow might not be able to detect the stream type correctly |
|
41 |
|
42 AM_MEDIA_TYPE mt = { MEDIATYPE_Stream, MEDIASUBTYPE_Avi, TRUE, FALSE, 1, GUID_NULL, 0, 0, 0}; |
40 |
43 |
41 QVector<AM_MEDIA_TYPE> ret; |
44 QVector<AM_MEDIA_TYPE> ret; |
42 //normal auto-detect stream |
|
43 ret << mt; |
|
44 //AVI stream |
45 //AVI stream |
45 mt.subtype = MEDIASUBTYPE_Avi; |
|
46 ret << mt; |
46 ret << mt; |
47 //WAVE stream |
47 //WAVE stream |
48 mt.subtype = MEDIASUBTYPE_WAVE; |
48 mt.subtype = MEDIASUBTYPE_WAVE; |
|
49 ret << mt; |
|
50 //normal auto-detect stream (must be at the end!) |
|
51 mt.subtype = MEDIASUBTYPE_NULL; |
49 ret << mt; |
52 ret << mt; |
50 return ret; |
53 return ret; |
51 } |
54 } |
52 |
55 |
53 class StreamReader : public QAsyncReader, public Phonon::StreamInterface |
56 class StreamReader : public QAsyncReader, public Phonon::StreamInterface |