[farsight2/master] Replace media_type AV (which doesn't exist) with application (which does)
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:19:11 PST 2008
---
gst-libs/gst/farsight/fs-codec.c | 13 ++++++-------
gst-libs/gst/farsight/fs-codec.h | 4 ++--
tests/check/base/fscodec.c | 16 ++++++++--------
3 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/gst-libs/gst/farsight/fs-codec.c b/gst-libs/gst/farsight/fs-codec.c
index 6178a5f..18eb899 100644
--- a/gst-libs/gst/farsight/fs-codec.c
+++ b/gst-libs/gst/farsight/fs-codec.c
@@ -80,7 +80,7 @@ fs_media_type_get_type (void)
static const GEnumValue values[] = {
{ FS_MEDIA_TYPE_AUDIO, "Audio (default)", "audio"},
{ FS_MEDIA_TYPE_VIDEO, "Video", "video"},
- { FS_MEDIA_TYPE_AV, "Audio/Video", "av" },
+ { FS_MEDIA_TYPE_APPLICATION, "Applicaton", "application" },
{0, NULL, NULL}
};
@@ -433,8 +433,8 @@ fs_media_type_to_string (FsMediaType media_type)
return "audio";
} else if (media_type == FS_MEDIA_TYPE_VIDEO) {
return "video";
- } else if (media_type == FS_MEDIA_TYPE_AV) {
- return "audiovideo";
+ } else if (media_type == FS_MEDIA_TYPE_APPLICATION) {
+ return "application";
} else {
return NULL;
}
@@ -575,10 +575,9 @@ fs_codec_to_gst_caps (const FsCodec *codec)
gst_structure_set (structure,
"clock-rate", G_TYPE_INT, codec->clock_rate, NULL);
- if (codec->media_type == FS_MEDIA_TYPE_AUDIO)
- gst_structure_set (structure, "media", G_TYPE_STRING, "audio", NULL);
- else if (codec->media_type == FS_MEDIA_TYPE_VIDEO)
- gst_structure_set (structure, "media", G_TYPE_STRING, "video", NULL);
+ if (fs_media_type_to_string (codec->media_type))
+ gst_structure_set (structure, "media", G_TYPE_STRING,
+ fs_media_type_to_string (codec->media_type), NULL);
if (codec->id >= 0 && codec->id < 128)
gst_structure_set (structure, "payload", G_TYPE_INT, codec->id, NULL);
diff --git a/gst-libs/gst/farsight/fs-codec.h b/gst-libs/gst/farsight/fs-codec.h
index fc02b3d..841613d 100644
--- a/gst-libs/gst/farsight/fs-codec.h
+++ b/gst-libs/gst/farsight/fs-codec.h
@@ -57,8 +57,8 @@ typedef enum
{
FS_MEDIA_TYPE_AUDIO,
FS_MEDIA_TYPE_VIDEO,
- FS_MEDIA_TYPE_AV,
- FS_MEDIA_TYPE_LAST = FS_MEDIA_TYPE_AV
+ FS_MEDIA_TYPE_APPLICATION,
+ FS_MEDIA_TYPE_LAST = FS_MEDIA_TYPE_APPLICATION
} FsMediaType;
/**
diff --git a/tests/check/base/fscodec.c b/tests/check/base/fscodec.c
index da05b29..fdb97d9 100644
--- a/tests/check/base/fscodec.c
+++ b/tests/check/base/fscodec.c
@@ -31,14 +31,14 @@ GST_START_TEST (test_fscodec_new)
{
FsCodec *codec = NULL;
- codec = fs_codec_new (1, "aa", FS_MEDIA_TYPE_AV, 650);
+ codec = fs_codec_new (1, "aa", FS_MEDIA_TYPE_APPLICATION, 650);
fail_if (codec == NULL, "Allocation failed");
fail_unless (codec->id == 1, "Codec is incorrect");
fail_unless (!strcmp (codec->encoding_name, "aa"),
"Codec encoding name incorrect");;
- fail_unless (codec->media_type == FS_MEDIA_TYPE_AV,
+ fail_unless (codec->media_type == FS_MEDIA_TYPE_APPLICATION,
"Codec media type incorrect");
fail_unless (codec->clock_rate == 650, "Codec clock rate incorrect");
@@ -49,20 +49,20 @@ GST_END_TEST;
GST_START_TEST (test_fscodec_are_equal)
{
- FsCodec *codec1 = fs_codec_new (1, "aa", FS_MEDIA_TYPE_AV, 650);
- FsCodec *codec2 = fs_codec_new (1, "aa", FS_MEDIA_TYPE_AV, 650);
+ FsCodec *codec1 = fs_codec_new (1, "aa", FS_MEDIA_TYPE_APPLICATION, 650);
+ FsCodec *codec2 = fs_codec_new (1, "aa", FS_MEDIA_TYPE_APPLICATION, 650);
fail_unless (fs_codec_are_equal (codec1, codec2) == TRUE,
"Identical codecs not recognized");
fs_codec_destroy (codec2);
- codec2 = fs_codec_new (2, "aa", FS_MEDIA_TYPE_AV, 650);
+ codec2 = fs_codec_new (2, "aa", FS_MEDIA_TYPE_APPLICATION, 650);
fail_unless (fs_codec_are_equal (codec1, codec2) == FALSE,
"Different codec ids not recognized");
fs_codec_destroy (codec2);
- codec2 = fs_codec_new (1, "aaa", FS_MEDIA_TYPE_AV, 650);
+ codec2 = fs_codec_new (1, "aaa", FS_MEDIA_TYPE_APPLICATION, 650);
fail_unless (fs_codec_are_equal (codec1, codec2) == FALSE,
"Different codec types not recognized");
fs_codec_destroy (codec2);
@@ -72,7 +72,7 @@ GST_START_TEST (test_fscodec_are_equal)
"Different media types not recognized");
fs_codec_destroy (codec2);
- codec2 = fs_codec_new (1, "aa", FS_MEDIA_TYPE_AV, 651);
+ codec2 = fs_codec_new (1, "aa", FS_MEDIA_TYPE_APPLICATION, 651);
fail_unless (fs_codec_are_equal (codec1, codec2) == FALSE,
"Different clock rates not recognized");
fs_codec_destroy (codec2);
@@ -82,7 +82,7 @@ GST_END_TEST;
static FsCodec *
init_codec_with_three_params (void)
{
- FsCodec *codec = fs_codec_new (1, "aa", FS_MEDIA_TYPE_AV, 650);
+ FsCodec *codec = fs_codec_new (1, "aa", FS_MEDIA_TYPE_APPLICATION, 650);
FsCodecParameter *p1 = NULL;
p1 = g_new0 (FsCodecParameter, 1);
--
1.5.6.5
More information about the farsight-commits
mailing list