expand format types handled in FormatManager::GetDescriptionForFormat
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5759 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -51,31 +51,46 @@ FormatManager::GetDescriptionForFormat(media_format_description *out_description
|
|||||||
|
|
||||||
if (in_family != B_META_FORMAT_FAMILY)
|
if (in_family != B_META_FORMAT_FAMILY)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (in_format.type == B_MEDIA_RAW_AUDIO) {
|
|
||||||
out_description->family = B_META_FORMAT_FAMILY;
|
|
||||||
strcpy(out_description->u.meta.description, "audiocodec/raw");
|
|
||||||
goto finished;
|
|
||||||
}
|
|
||||||
if (in_format.type == B_MEDIA_RAW_VIDEO) {
|
|
||||||
out_description->family = B_META_FORMAT_FAMILY;
|
|
||||||
strcpy(out_description->u.meta.description, "videocodec/raw");
|
|
||||||
goto finished;
|
|
||||||
}
|
|
||||||
|
|
||||||
out_description->family = B_META_FORMAT_FAMILY;
|
out_description->family = B_META_FORMAT_FAMILY;
|
||||||
switch (in_format.u.encoded_audio.encoding) {
|
|
||||||
|
|
||||||
case B_WAV_FORMAT_FAMILY:
|
|
||||||
case B_MPEG_FORMAT_FAMILY:
|
|
||||||
strcpy(out_description->u.meta.description, "audiocodec/mpeg1layer3");
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
switch (in_format.type) {
|
||||||
return B_ERROR;
|
case B_MEDIA_RAW_AUDIO:
|
||||||
|
strcpy(out_description->u.meta.description, "audiocodec/raw");
|
||||||
|
break;
|
||||||
|
case B_MEDIA_RAW_VIDEO:
|
||||||
|
strcpy(out_description->u.meta.description, "videocodec/raw");
|
||||||
|
break;
|
||||||
|
case B_MEDIA_ENCODED_AUDIO:
|
||||||
|
switch (in_format.u.encoded_audio.encoding) {
|
||||||
|
|
||||||
|
case B_WAV_FORMAT_FAMILY:
|
||||||
|
case B_MPEG_FORMAT_FAMILY:
|
||||||
|
strcpy(out_description->u.meta.description, "audiocodec/mpeg1layer3");
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case B_MEDIA_ENCODED_VIDEO:
|
||||||
|
switch (in_format.u.encoded_video.encoding) {
|
||||||
|
|
||||||
|
case B_MPEG_FORMAT_FAMILY:
|
||||||
|
strcpy(out_description->u.meta.description, "videocodec/mpeg");
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case B_MEDIA_UNKNOWN_TYPE:
|
||||||
|
debugger("FormatManager::GetDescriptionForFormat");
|
||||||
|
strcpy(out_description->u.meta.description, "unknown");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
debugger("FormatManager::GetDescriptionForFormat");
|
||||||
}
|
}
|
||||||
|
|
||||||
finished:
|
|
||||||
printf(" description: %s\n",
|
printf(" description: %s\n",
|
||||||
string_for_description(*out_description, s, sizeof(s)));
|
string_for_description(*out_description, s, sizeof(s)));
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user