small cleanup, format type and encoding depends on the description

and is set by the media kit, not by the reader


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5584 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2003-12-05 23:46:53 +00:00
parent ac800e9cd8
commit 4cbbc5a9ec
4 changed files with 6 additions and 18 deletions
@@ -208,7 +208,7 @@ mp3Reader::AllocateCookie(int32 streamNumber, void **cookie)
_get_format_for_description(&data->format, description);
data->format.u.encoded_audio.encoding = media_encoded_audio_format::B_ANY;
// data->format.u.encoded_audio.encoding = media_encoded_audio_format::B_ANY;
data->format.u.encoded_audio.bit_rate = bit_rate;
data->format.u.encoded_audio.frame_size = frame_size;
// data->format.u.encoded_audio.output.frame_rate = data->frameRate;
@@ -128,7 +128,7 @@ WavReader::AllocateCookie(int32 streamNumber, void **cookie)
_get_format_for_description(&data->format, description);
data->format.type = B_MEDIA_RAW_AUDIO;
//data->format.type = B_MEDIA_RAW_AUDIO;
data->format.u.raw_audio.frame_rate = data->fps;
data->format.u.raw_audio.channel_count = B_LENDIAN_TO_HOST_INT16(fRawHeader.common.channels);
data->format.u.raw_audio.format = media_raw_audio_format::B_AUDIO_SHORT; // XXX fixme
-15
View File
@@ -49,21 +49,6 @@ MediaExtractor::MediaExtractor(BDataIO * source, int32 flags)
fStreamInfo[i].status = B_ERROR;
printf("MediaExtractor::MediaExtractor: GetStreamInfo for stream %ld failed\n", i);
}
char sz[1024];
string_for_format(fStreamInfo[i].encodedFormat, sz, sizeof(sz));
printf("MediaExtractor::MediaExtractor: stream %d has format %s\n", i, sz);
fStreamInfo[i].encodedFormat.type = B_MEDIA_ENCODED_AUDIO;
fStreamInfo[i].encodedFormat.u.encoded_audio.encoding = (enum media_encoded_audio_format::audio_encoding) 1;
fStreamInfo[i].encodedFormat.u.encoded_audio.bit_rate = 128000;
fStreamInfo[i].encodedFormat.u.encoded_audio.frame_size = 3000;
fStreamInfo[i].encodedFormat.u.encoded_audio.output.frame_rate = 44100;
fStreamInfo[i].encodedFormat.u.encoded_audio.output.channel_count = 2;
fStreamInfo[i].encodedFormat.u.encoded_audio.output.format = 2;
fStreamInfo[i].encodedFormat.u.encoded_audio.output.byte_order = B_MEDIA_LITTLE_ENDIAN;
fStreamInfo[i].encodedFormat.u.encoded_audio.output.buffer_size = 4 * 1024;
string_for_format(fStreamInfo[i].encodedFormat, sz, sizeof(sz));
printf("MediaExtractor::MediaExtractor: stream %d has new format %s\n", i, sz);
}
}
+4 -1
View File
@@ -307,7 +307,10 @@ _get_format_for_description(media_format *out_format, const media_format_descrip
// if (B_OK != QueryServer(SERVER_GET_FORMAT_FOR_DESCRIPTION, &request, sizeof(request), &reply, sizeof(reply)))
// return B_ERROR;
reply.format.type = B_MEDIA_ENCODED_AUDIO;
reply.format.u.encoded_audio.encoding = (enum media_encoded_audio_format::audio_encoding) 1;
*out_format = reply.format;
return B_OK;
}