expand upon this example
This is not so much an issue per se as a request for help. I am trying to build a GTK app, using gtk4
, and incorporating gstreamer
video stream/s into it. I am trying to use this project as an example and point of departure, but am finding myself stuck and would like some advice on how to proceed.
What is the objective? For starters, something very similar to what this project renders -- a video stream displayed in a GTK widget -- only I would like to replace the camera source with a pipeline from a filesrc
element.
What have I tried? Well, a couple of things:
-
The first thing I tried was to copy/paste your
CameraSink
code into a very basic GTK4 bin. Your project compiles and runs just fine on my machine, but as soon as I move thecamera_sink
module into my own project, I get very strange and mysterious compiler errors. Eg. 1)glib::object_subclass!
is not a macro, 2) failed to resolvetype Class = subclass::simple::ClassStruct<Self>;
becausesimple
is not found insubclass
, 3)ElementInstanceStruct
is not found ingst::subclass
(there are other errors as well, but these are the most immediately confounding). NB: I am using the samegtk
andgst
dependencies as your project. -
The next thing I tried was simply to modify your project to change the [
autovideosrc
,videoconvert
,queue
,sink
] pipeline into a [filesrc
,oggdemux
,theoradec
,sink
] pipeline (using anogv
as the sample source file). This compiled just fine, but I get a runtime error linking the demux element to the decode element. I am aware of the issue illustrated in this example, but its relevance to my situation is not clear. Of note, I don't understand why your code does not need to go through such trickery to work correctly(?).
I'm just giving a hand-wavy description of the problems I've encountered because I don't want to dump a lot of detail here now. If there is anything in the above description that might give you some notion of what I'm doing wrong, such that you can point me in the right direction to a better understanding -- towards some documentation, or a piece of example code, that might help me do what I'm trying to do -- I would be immensely appreciative. If you would prefer that I produce some gist or other sort of code sample, I could do this as well.
Thank you for this example, and for any consideration you can give to my request...