45 |
45 |
46 #include <gst/gstversion.h> |
46 #include <gst/gstversion.h> |
47 |
47 |
48 struct QGstreamerMetaDataKeyLookup |
48 struct QGstreamerMetaDataKeyLookup |
49 { |
49 { |
50 QtMediaServices::MetaData key; |
50 QtMultimedia::MetaData key; |
51 const char *token; |
51 const char *token; |
52 }; |
52 }; |
53 |
53 |
54 static const QGstreamerMetaDataKeyLookup qt_gstreamerMetaDataKeys[] = |
54 static const QGstreamerMetaDataKeyLookup qt_gstreamerMetaDataKeys[] = |
55 { |
55 { |
56 { QtMediaServices::Title, GST_TAG_TITLE }, |
56 { QtMultimedia::Title, GST_TAG_TITLE }, |
57 //{ QtMediaServices::SubTitle, 0 }, |
57 //{ QtMultimedia::SubTitle, 0 }, |
58 //{ QtMediaServices::Author, 0 }, |
58 //{ QtMultimedia::Author, 0 }, |
59 { QtMediaServices::Comment, GST_TAG_COMMENT }, |
59 { QtMultimedia::Comment, GST_TAG_COMMENT }, |
60 { QtMediaServices::Description, GST_TAG_DESCRIPTION }, |
60 { QtMultimedia::Description, GST_TAG_DESCRIPTION }, |
61 //{ QtMediaServices::Category, 0 }, |
61 //{ QtMultimedia::Category, 0 }, |
62 { QtMediaServices::Genre, GST_TAG_GENRE }, |
62 { QtMultimedia::Genre, GST_TAG_GENRE }, |
63 { QtMediaServices::Year, "year" }, |
63 { QtMultimedia::Year, "year" }, |
64 //{ QtMediaServices::UserRating, 0 }, |
64 //{ QtMultimedia::UserRating, 0 }, |
65 |
65 |
66 { QtMediaServices::Language, GST_TAG_LANGUAGE_CODE }, |
66 { QtMultimedia::Language, GST_TAG_LANGUAGE_CODE }, |
67 |
67 |
68 { QtMediaServices::Publisher, GST_TAG_ORGANIZATION }, |
68 { QtMultimedia::Publisher, GST_TAG_ORGANIZATION }, |
69 { QtMediaServices::Copyright, GST_TAG_COPYRIGHT }, |
69 { QtMultimedia::Copyright, GST_TAG_COPYRIGHT }, |
70 //{ QtMediaServices::ParentalRating, 0 }, |
70 //{ QtMultimedia::ParentalRating, 0 }, |
71 //{ QtMediaServices::RatingOrganisation, 0 }, |
71 //{ QtMultimedia::RatingOrganisation, 0 }, |
72 |
72 |
73 // Media |
73 // Media |
74 //{ QtMediaServices::Size, 0 }, |
74 //{ QtMultimedia::Size, 0 }, |
75 //{ QtMediaServices::MediaType, 0 }, |
75 //{ QtMultimedia::MediaType, 0 }, |
76 { QtMediaServices::Duration, GST_TAG_DURATION }, |
76 { QtMultimedia::Duration, GST_TAG_DURATION }, |
77 |
77 |
78 // Audio |
78 // Audio |
79 { QtMediaServices::AudioBitRate, GST_TAG_BITRATE }, |
79 { QtMultimedia::AudioBitRate, GST_TAG_BITRATE }, |
80 { QtMediaServices::AudioCodec, GST_TAG_AUDIO_CODEC }, |
80 { QtMultimedia::AudioCodec, GST_TAG_AUDIO_CODEC }, |
81 //{ QtMediaServices::ChannelCount, 0 }, |
81 //{ QtMultimedia::ChannelCount, 0 }, |
82 //{ QtMediaServices::SampleRate, 0 }, |
82 //{ QtMultimedia::SampleRate, 0 }, |
83 |
83 |
84 // Music |
84 // Music |
85 { QtMediaServices::AlbumTitle, GST_TAG_ALBUM }, |
85 { QtMultimedia::AlbumTitle, GST_TAG_ALBUM }, |
86 { QtMediaServices::AlbumArtist, GST_TAG_ARTIST}, |
86 { QtMultimedia::AlbumArtist, GST_TAG_ARTIST}, |
87 { QtMediaServices::ContributingArtist, GST_TAG_PERFORMER }, |
87 { QtMultimedia::ContributingArtist, GST_TAG_PERFORMER }, |
88 #if (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19) |
88 #if (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19) |
89 { QtMediaServices::Composer, GST_TAG_COMPOSER }, |
89 { QtMultimedia::Composer, GST_TAG_COMPOSER }, |
90 #endif |
90 #endif |
91 //{ QtMediaServices::Conductor, 0 }, |
91 //{ QtMultimedia::Conductor, 0 }, |
92 //{ QtMediaServices::Lyrics, 0 }, |
92 //{ QtMultimedia::Lyrics, 0 }, |
93 //{ QtMediaServices::Mood, 0 }, |
93 //{ QtMultimedia::Mood, 0 }, |
94 { QtMediaServices::TrackNumber, GST_TAG_TRACK_NUMBER }, |
94 { QtMultimedia::TrackNumber, GST_TAG_TRACK_NUMBER }, |
95 |
95 |
96 //{ QtMediaServices::CoverArtUrlSmall, 0 }, |
96 //{ QtMultimedia::CoverArtUrlSmall, 0 }, |
97 //{ QtMediaServices::CoverArtUrlLarge, 0 }, |
97 //{ QtMultimedia::CoverArtUrlLarge, 0 }, |
98 |
98 |
99 // Image/Video |
99 // Image/Video |
100 //{ QtMediaServices::Resolution, 0 }, |
100 //{ QtMultimedia::Resolution, 0 }, |
101 //{ QtMediaServices::PixelAspectRatio, 0 }, |
101 //{ QtMultimedia::PixelAspectRatio, 0 }, |
102 |
102 |
103 // Video |
103 // Video |
104 //{ QtMediaServices::VideoFrameRate, 0 }, |
104 //{ QtMultimedia::VideoFrameRate, 0 }, |
105 //{ QtMediaServices::VideoBitRate, 0 }, |
105 //{ QtMultimedia::VideoBitRate, 0 }, |
106 { QtMediaServices::VideoCodec, GST_TAG_VIDEO_CODEC }, |
106 { QtMultimedia::VideoCodec, GST_TAG_VIDEO_CODEC }, |
107 |
107 |
108 //{ QtMediaServices::PosterUrl, 0 }, |
108 //{ QtMultimedia::PosterUrl, 0 }, |
109 |
109 |
110 // Movie |
110 // Movie |
111 //{ QtMediaServices::ChapterNumber, 0 }, |
111 //{ QtMultimedia::ChapterNumber, 0 }, |
112 //{ QtMediaServices::Director, 0 }, |
112 //{ QtMultimedia::Director, 0 }, |
113 { QtMediaServices::LeadPerformer, GST_TAG_PERFORMER }, |
113 { QtMultimedia::LeadPerformer, GST_TAG_PERFORMER }, |
114 //{ QtMediaServices::Writer, 0 }, |
114 //{ QtMultimedia::Writer, 0 }, |
115 |
115 |
116 // Photos |
116 // Photos |
117 //{ QtMediaServices::CameraManufacturer, 0 }, |
117 //{ QtMultimedia::CameraManufacturer, 0 }, |
118 //{ QtMediaServices::CameraModel, 0 }, |
118 //{ QtMultimedia::CameraModel, 0 }, |
119 //{ QtMediaServices::Event, 0 }, |
119 //{ QtMultimedia::Event, 0 }, |
120 //{ QtMediaServices::Subject, 0 } |
120 //{ QtMultimedia::Subject, 0 } |
121 }; |
121 }; |
122 |
122 |
123 QGstreamerMetaDataProvider::QGstreamerMetaDataProvider(QGstreamerPlayerSession *session, QObject *parent) |
123 QGstreamerMetaDataProvider::QGstreamerMetaDataProvider(QGstreamerPlayerSession *session, QObject *parent) |
124 :QMetaDataControl(parent), m_session(session) |
124 :QMetaDataReaderControl(parent), m_session(session) |
125 { |
125 { |
126 connect(m_session, SIGNAL(tagsChanged()), SLOT(updateTags())); |
126 connect(m_session, SIGNAL(tagsChanged()), SLOT(updateTags())); |
127 } |
127 } |
128 |
128 |
129 QGstreamerMetaDataProvider::~QGstreamerMetaDataProvider() |
129 QGstreamerMetaDataProvider::~QGstreamerMetaDataProvider() |