531
531
* @prof: a #GstEncodingVideoProfile
532
532
* @variableframerate: a boolean
534
* If set to %TRUE, then the incoming streamm will be allowed to have non-constant
534
* If set to %TRUE, then the incoming stream will be allowed to have non-constant
535
535
* framerate. If set to %FALSE (default value), then the incoming stream will
536
536
* be normalized by dropping/duplicating frames in order to produce a
537
537
* constance framerate.
969
* gst_encoding_profile_from_discoverer:
970
* @info: (transfer none): The #GstDiscovererInfo to read from
972
* Creates a #GstEncodingProfile matching the formats from the given
973
* #GstEncodingProfile. Streams other than audio or video (eg,
974
* subtitles), are currently ignored.
976
* Returns: (transfer full): The new #GstEncodingProfile or %NULL.
981
gst_encoding_profile_from_discoverer (GstDiscovererInfo * info)
983
GstEncodingContainerProfile *profile;
984
GstDiscovererStreamInfo *sinfo;
985
GList *streams, *stream;
986
GstCaps *caps = NULL;
988
if (!info || gst_discoverer_info_get_result (info) != GST_DISCOVERER_OK)
991
sinfo = gst_discoverer_info_get_stream_info (info);
995
caps = gst_discoverer_stream_info_get_caps (sinfo);
996
GST_LOG ("Container: %" GST_PTR_FORMAT "\n", caps);
998
gst_encoding_container_profile_new ("auto-generated",
999
"Automatically generated from GstDiscovererInfo", caps, NULL);
1000
gst_caps_unref (caps);
1002
GST_ERROR ("Failed to create container profile from caps %" GST_PTR_FORMAT,
1008
gst_discoverer_container_info_get_streams (GST_DISCOVERER_CONTAINER_INFO
1010
for (stream = streams; stream; stream = stream->next) {
1011
GstEncodingProfile *sprofile = NULL;
1012
sinfo = (GstDiscovererStreamInfo *) stream->data;
1013
caps = gst_discoverer_stream_info_get_caps (sinfo);
1014
GST_LOG ("Stream: %" GST_PTR_FORMAT "\n", caps);
1015
if (GST_IS_DISCOVERER_AUDIO_INFO (sinfo)) {
1017
(GstEncodingProfile *) gst_encoding_audio_profile_new (caps, NULL,
1019
} else if (GST_IS_DISCOVERER_VIDEO_INFO (sinfo)) {
1021
(GstEncodingProfile *) gst_encoding_video_profile_new (caps, NULL,
1024
/* subtitles or other ? ignore for now */
1027
gst_encoding_container_profile_add_profile (profile, sprofile);
1029
GST_ERROR ("Failed to create stream profile from caps %" GST_PTR_FORMAT,
1031
gst_caps_unref (caps);
1033
gst_discoverer_stream_info_list_free (streams);
1035
return (GstEncodingProfile *) profile;