1
0
Fork 0
Commit graph

16 commits

Author SHA1 Message Date
Lionel Landwerlin
1b2dd815b4 Registers gtypes for all public objects and structs
This adds much more comprehensive support for gobject-introspection
based bindings by registering all objects as fundamental types that
inherit from CoglObject, and all structs as boxed types.

Co-Author: Robert Bragg <robert@linux.intel.com>

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 18:27:12 +00:00
Robert Bragg
849f691969 cogl-gst: add cogl_gst_video_sink_get_natural_size() api
This adds api for querying a "natural" width and height for a video
which has the correct aspect ratio for displaying on square, 1:1 pixels.

The natural size is the minimum size where downscaling is not required.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
a0441778ad This re-licenses Cogl 1.18 under the MIT license
Since the Cogl 1.18 branch is actively maintained in parallel with the
master branch; this is a counter part to commit 1b83ef938fc16b which
re-licensed the master branch to use the MIT license.

This re-licensing is a follow up to the proposal that was sent to the
Cogl mailing list:
http://lists.freedesktop.org/archives/cogl/2013-December/001465.html

Note: there was a copyright assignment policy in place for Clutter (and
therefore Cogl which was part of Clutter at the time) until the 11th of
June 2010 and so we only checked the details after that point (commit
0bbf50f905)

For each file, authors were identified via this Git command:
$ git blame -p -C -C -C20 -M -M10  0bbf50f905..HEAD

We received blanket approvals for re-licensing all Red Hat and Collabora
contributions which reduced how many people needed to be contacted
individually:
- http://lists.freedesktop.org/archives/cogl/2013-December/001470.html
- http://lists.freedesktop.org/archives/cogl/2014-January/001536.html

Individual approval requests were sent to all the other identified authors
who all confirmed the re-license on the Cogl mailinglist:
http://lists.freedesktop.org/archives/cogl/2014-January

As well as updating the copyright header in all sources files, the
COPYING file has been updated to reflect the license change and also
document the other licenses used in Cogl such as the SGI Free Software
License B, version 2.0 and the 3-clause BSD license.

This patch was not simply cherry-picked from master; but the same
methodology was used to check the source files.
2014-02-22 02:02:53 +00:00
Neil Roberts
2543a86ba1 cogl-gst-video-sink: Premultiply the colors coming from the video
Commit 99a53c82e9ab0a1e5 removed the internal format argument when
uploading a video frame to a texture so that the format will just be
determined automatically from the image format. However this also
leaves the premultiplied state at the default and the default is TRUE.
That means that when we upload RGBA data Cogl will do a premultiplied
conversion on the CPU. We probably don't want to be putting a CPU
conversion in the way of video frames so this patch changes it to set
the premultiplied state to FALSE on the textures and then do the
premultiplied conversion in the shader.

This is particularly important for AYUV which uses the alpha channel
for the V component so doing a premultiplied conversion on the CPU
just creates garbage and messes up the image.

The RGB and RGBA renderers have each been split into two; one that
uses GLSL and one that uses a regular pipeline. The RGBA pipeline
without GLSL is then changed to use 2 layers so we that we can do the
premultiplied conversion in the second layer with a special layer
combine string.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 07a57f26596c72507035369c90ed6d62568330b5)
2014-01-31 12:42:03 +00:00
Robert Bragg
6436cd073d Declare interface types as void and remove cast macros
This declares the interface types CoglFramebuffer, CoglBuffer,
CoglTexture, CoglMetaTexture and CoglPrimitiveTexture as void when
including the public cogl.h header so that users don't have to use lots
of C type casts between instance types and interface types.

This also removes all of the COGL_XYZ() type cast macros since they do
nothing more than compile time type casting but it's less readable if
you haven't seen that coding pattern before.

Unlike with gobject based apis that use per-type macros for casting and
performing runtime type checking we instead prefer to do our runtime
type checking internally within the front-end public apis when objects
are passed into Cogl. This greatly reduces the verbosity for users of
the api and may help reduce the chance of excessive runtime type
checking that can sometimes be a problem.

(cherry picked from commit 248a76f5eac7e5ae4fb45208577f9a55360812a7)

Since we can't break the 1.x api this version of the patch actually
defines compatible NOP macros within deprecated/cogl-type-casts.h
2013-11-27 19:33:44 +00:00
Lionel Landwerlin
447488dd5b cogl-gst: add missing annotations
Reviewed-by: Robert Bragg <robert@linux.intel.com>
2013-09-23 15:02:32 +01:00
Robert Bragg
4d5af45d99 cogl-gst: adds _sink_is_ready() api
This adds a cogl_gst_video_sink_is_ready() for code to be able to
check if it's safe to call cogl_gst_video_sink_get_pipeline() or
cogl_gst_video_sink_setup_pipeline() without causing an error.
Normally an application can listen for the pipeline-ready signal but
sometimes a sink can be passed between components that didn't have an
opportunity to connect a signal handler, so they need a way to
directly check the status.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 9e7db391a87beee7c448f2a67b3e7202779ce9b2)
2013-07-25 16:46:18 +01:00
Robert Bragg
5faed43f29 cogl-gst: expose aspect ratio apis
This adds several utility apis that aim to make it as easy as possible
for an application to determine what size a video should be drawn at.

The important detail here is that these apis take into account the
pixel-aspect-ratio in addition to the video's own aspect ratio.

This patch updates the cogl-basic-video-player example to use the
cogl_gst_video_sink_fit_size() api to perform letterboxing.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit d26f17c97ff6b9f6d6211e0527d5965a85305a56)
2013-06-21 19:06:59 +01:00
Neil Roberts
ee559d4e93 cogl-gst: Remove the return value from attach_frame()
Previously cogl_gst_video_sink_attach_frame returned the last layer
used by the sink. This can also be retrieved via
cogl_gst_video_sink_get_free_layer so I don't think it's necessary to
return it here and it seems kind of out of place.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 0805f3e9db715fc2c97b7e60d4f3a25e7fa598fc)
2013-06-21 19:05:36 +01:00
Neil Roberts
735bf63063 cogl-gst: Move the PARAM macros into the C file
These are just internal convenience macros to define the GObject
properties so they shouldn't be in the public headers.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit b7b861aa87ad05a2c253afdd87323acd82fd988f)
2013-06-21 19:05:16 +01:00
Neil Roberts
5f86563c86 cogl-gst: Add some documentation
Adds documentation comments to CoglGstVideoSink and makes it generate
a separate manual to contain it.

One thing that I wasn't able to figure out with this was how to get
the documentation to have correct references to the main Cogl docs.
You can pass arguments to gtkdoc-fixxref to point to other manuals,
but presumably this needs the installed locations and when the
Cogl-Gst documentation is generated the Cogl docs may not have been
installed yet.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 5acdf8db47311893a9cf9ea04a66a287b657b8b0)
2013-06-21 19:04:52 +01:00
Neil Roberts
c50b302fc4 cogl-gst: Remove the unused cogl_gst_video_sink_get_main_loop
This declaration was a leftover from a previous iteration of the
CoglGST patches.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 53ae6d39efa113e28f5d1177ccb8613ddf28ee43)
2013-06-21 19:03:24 +01:00
Plamena Manolova
282505ba99 cogl-gst: Add a functions to facilitate layering
These functions are used when attaching frames at a start point other
than layer 0 is required. This could potentially be used to "layer"
videos and textures on top of each other in the CoglPipeline. This
layering could come handy if videos are used as alpha masks or normal
maps, or when arranging layers in a perticular order, so Cogl could
blend them nicely without extra hassle.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit f98b437c9ea79f04ef1ebbb6ff547f58b49b0008)
2013-06-21 19:03:04 +01:00
Neil Roberts
e85a681788 cogl-gst: Remove ‘FLOP’
This is an inappropriately pessimistic remark for the header of
CoglGstVideoSink.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit ce2a70165054fea3e9d992c14650ba8cccf60e97)
2013-06-21 19:02:15 +01:00
Robert Bragg
adcaf27106 cogl-gst: pedantic style fixes in cogl-gst-video-sink.h
There were a few hugging pointer asterisks and inconsistent newlines for
a prototype which this patch tweaks.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 488c074316b270b17d1000c68f26210108b1b0ca)
2013-06-21 18:59:14 +01:00
Plamena Manolova
1eca1631a7 Include CoglGst
CoglGst is a GStreamer integration library that facilitates
video playback using the Cogl API. It works by retrieving
each video frame from the GStreamer pipeline and attaching
it to a Cogl pipeline in the form of a Cogl texture along
with possible color model conversion shaders. The pipeline
is then retrieved by the user during each draw. An example
use of the CoglGst API is included in the examples directory.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit dfb94cf4b0b6b42d6465df362a0c0af780596890)
2013-06-21 18:57:24 +01:00