~ubuntu-branches/ubuntu/precise/gst-plugins-base0.10/precise-updates

« back to all changes in this revision

Viewing changes to gst-libs/gst/pbutils/encoding-profile.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2011-12-11 19:27:10 UTC
  • mfrom: (11.7.12) (33.1.11 sid)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: package-import@ubuntu.com-20111211192710-f52020gqtas8705f
Tags: 0.10.35.2-1
* New upstream pre-release:
  + debian/rules,
    debian/build-deps.in:
    - Build-depend on GStreamer core >= 0.10.35.2.
    - Build-depend on GLib >= 2.24.
    - Build-depend on GTK+ 3.0.
    - Build-depend on zlib.
  + debian/patches/99_ltmain_as-needed.patch:
    - Refresh to apply cleanly again.
  + debian/libgstreamer-plugins-base.symbols:
    - Update symbols file with new API.
* debian/rules:
  + Remove all dependency_libs from the .la files.
* debian/control.in:
  + Put GI package into section introspection.
* debian/build-deps.in,
  debian/compat,
  debian/control.in,
  debian/gir1.2-gst-plugins-base.install,
  debian/gstreamer-alsa.install,
  debian/gstreamer-gnomevfs.install,
  debian/gstreamer-plugins-base.install,
  debian/gstreamer-x.install,
  debian/libgstreamer-plugins-base-dev.install,
  debian/libgstreamer-plugins-base.install,
  debian/rules:
  + Transition package to multi-arch (Closes: #647485).
    Patch taken from the Ubuntu package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
531
531
 * @prof: a #GstEncodingVideoProfile
532
532
 * @variableframerate: a boolean
533
533
 *
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.
964
964
 
965
965
  return FALSE;
966
966
}
 
967
 
 
968
/**
 
969
 * gst_encoding_profile_from_discoverer:
 
970
 * @info: (transfer none): The #GstDiscovererInfo to read from
 
971
 *
 
972
 * Creates a #GstEncodingProfile matching the formats from the given
 
973
 * #GstEncodingProfile. Streams other than audio or video (eg,
 
974
 * subtitles), are currently ignored.
 
975
 *
 
976
 * Returns: (transfer full): The new #GstEncodingProfile or %NULL.
 
977
 *
 
978
 * Since: 0.10.36
 
979
 */
 
980
GstEncodingProfile *
 
981
gst_encoding_profile_from_discoverer (GstDiscovererInfo * info)
 
982
{
 
983
  GstEncodingContainerProfile *profile;
 
984
  GstDiscovererStreamInfo *sinfo;
 
985
  GList *streams, *stream;
 
986
  GstCaps *caps = NULL;
 
987
 
 
988
  if (!info || gst_discoverer_info_get_result (info) != GST_DISCOVERER_OK)
 
989
    return NULL;
 
990
 
 
991
  sinfo = gst_discoverer_info_get_stream_info (info);
 
992
  if (!sinfo)
 
993
    return NULL;
 
994
 
 
995
  caps = gst_discoverer_stream_info_get_caps (sinfo);
 
996
  GST_LOG ("Container: %" GST_PTR_FORMAT "\n", caps);
 
997
  profile =
 
998
      gst_encoding_container_profile_new ("auto-generated",
 
999
      "Automatically generated from GstDiscovererInfo", caps, NULL);
 
1000
  gst_caps_unref (caps);
 
1001
  if (!profile) {
 
1002
    GST_ERROR ("Failed to create container profile from caps %" GST_PTR_FORMAT,
 
1003
        caps);
 
1004
    return NULL;
 
1005
  }
 
1006
 
 
1007
  streams =
 
1008
      gst_discoverer_container_info_get_streams (GST_DISCOVERER_CONTAINER_INFO
 
1009
      (sinfo));
 
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)) {
 
1016
      sprofile =
 
1017
          (GstEncodingProfile *) gst_encoding_audio_profile_new (caps, NULL,
 
1018
          NULL, 0);
 
1019
    } else if (GST_IS_DISCOVERER_VIDEO_INFO (sinfo)) {
 
1020
      sprofile =
 
1021
          (GstEncodingProfile *) gst_encoding_video_profile_new (caps, NULL,
 
1022
          NULL, 0);
 
1023
    } else {
 
1024
      /* subtitles or other ? ignore for now */
 
1025
    }
 
1026
    if (sprofile)
 
1027
      gst_encoding_container_profile_add_profile (profile, sprofile);
 
1028
    else
 
1029
      GST_ERROR ("Failed to create stream profile from caps %" GST_PTR_FORMAT,
 
1030
          caps);
 
1031
    gst_caps_unref (caps);
 
1032
  }
 
1033
  gst_discoverer_stream_info_list_free (streams);
 
1034
 
 
1035
  return (GstEncodingProfile *) profile;
 
1036
}