How to set the property of sink pad of element in gstreamer? - c

How to set the property of sink pad in program
for example:
sin_00::outWidth=1280 sin_00::outHeight=720 in this way pipeline was run using gst-launch-0.10 .....
And to set this property Ive used gst_pad_set_property() API but its not working
it shows following error :
3_video_temp.c: In function 'main':
3_video_temp.c:551: warning: implicit declaration of function 'gst_pad_set_property'
/tmp/cc2zDbzt.o: In function `main':
/home/project/compWorkspace/Edubeam/3_video_temp.c:551: undefined reference to `gst_pad_set_property'
collect2: ld returned 1 exit status
make: *** [all] Error 1
Please tell how to set that value as soon as possible.

If the pads have properties (like the pads in videomixer has), you just use g_object_set like you would with any property, so something like:
g_object_set (pad, "width", 1280, NULL);

Most pads don't have properties. width and height are usually negotiated via caps that are set on buffers and pads.

What version of GStreamer do you have installed on your system? Quickly check using:
gst-inspect --version
Where did you find a doc or example for gst_pad_set_property()? I just searched for gst_pad_set_property in /usr/include/gstreamer-0.10/gst/* on my Linux development system and came up empty-handed. But when I search through the latest source snapshot for GStreamer, the function appears. This leads me to believe you might be looking at docs or examples for an in-development version of GStreamer that has new convenience APIs not seen in earlier versions (I have run into similar problems on occasion).
Exactly what property are you trying to set on the sink pad?

Related

SWUpdate on RPi4 via yocto - error parsing configuration file

After booting SWUpdate yocto-generated image for the first time, executing swupdate results in error message:
Error parsing configuration file: 'globals' section missing, exiting.
I tried to strictly follow SWUpdate's documentation, but it gets short when it comes to yocto integration. I'm using meta-swupdate, meta-swupdate-boards, and meta-openembedded layers together with poky example repository all at Kirkstone tag, building via bitbake update-image and having modyfied local.conf as:
MACHINE ??= "raspberrypi4-64"
ENABLE_UART = "1"
RPI_USE_U_BOOT = "1"
IMAGE_FSTYPES = "wic ext4.gz"
PREFERRED_PROVIDER_u-boot-fw-utils = "libubootenv"
IMAGE_INSTALL:append = " swupdate"
Is there anything else I need to modify to generate the configuration file and be able to run SWUpdate binary properly?
Side question: In the documentation, it's recommended to append swupdate-www to achieve a better web server. However, if I append it, there is no swupdate-www binary inside the `/usr/bin' directory.
As with other recipes folders the recipes-support/swupdate/swupdate/raspberrypi4-64 folder was missing inside the meta-swupdate-boards layer. Therefore, an empty config file was always generated. After adding this folder and all related files, strongly inspired by raspberrypi3 folder, the error was gone and swupdate -h provided the expected output.
There was also one new error during build process thrown by yocto. It was related to missing systemd requirement and was solved by adding:
DISTRO_FEATURES_append = " systemd"
to local.conf

Problems trying to build custom micropython firmware for STM32

I am trying to build custom Micropython firmware with ethernet support for STM32F407VE. I've forked working board without ethernet support and trying to modify it with ethernet support.
Things I have done:
defined MICROPY_HW_ETH_* variables in mpconfigboard.h
added MICROPY_PY_LWIP = 1 to mpconfigboard.mk
added ETH_* pins to pins.csv
added additional pins from Port F, G, H, I to pins.csv
Here is my modified board: https://github.com/untitledlt/BLACK_F407VE
Now when I'm trying to build it, i get:
In file included from eth.c:31:
eth.c: In function 'eth_mac_init':
eth.c:163:106: error: implicit declaration of function 'STATIC_AF_ETH_RMII_REF_CLK'; did you mean 'STATIC_AF_ETH_RMII__REF_CLK'? [-Werror=implicit-function-declaration]
mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_REF_CLK, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_REF_CLK);
^~~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:42:48: note: in definition of macro 'mp_hal_pin_config_alt_static'
mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
^~~~~~~
cc1: all warnings being treated as errors
make: *** [build-BLACK_F407VE/eth.o] Error 1
What am I doing wrong here?
There was a bug (typo) in Micropython branch.
ETH_RMII__REF_CLK should be replaced with ETH_RMII_REF_CLK in ports/stm32/boards/stm32f405_af.csv file.
It's already fixed by https://github.com/micropython/micropython/pull/5308.
All Credit goes to Mike Causer.
Thanks, Mike!

What does SDL_GetError say in the case of an error?

My main question: Please may you list a few examples of what SDL_GetError would print?
I want to use SDL_GetError to help me debug, however I don't know what to expect or how to create my own intentional errors.
The libsdl wiki says:
The message is only applicable when an SDL function has signaled an
error. You must check the return values of SDL function calls to determine
when to appropriately call SDL_GetError().
however http://sdl.beuc.net/sdl.wiki/SDL_GetError says:
Although this example uses SDL_Init, SDL_GetError provides an error
message for any failed SDL operation.
so which is it? Only some or all? None of the SDL wikis/documentations I have seen give a list of example error messages, so I don't know how to initiate an error, or what to expect in terms of content and format. Is
Error in `./foo': double free or corruption (top):
an SDL_GetError message or is that caused by something else?
The wiki entry for SDL_Error lists the error strings:
SDL_errorcode | The corresponding error string
SDL_ENOMEM | Out of memory
SDL_EFREAD | Error reading from datastream
SDL_EFWRITE | Error writing to datastream
SDL_EFSEEK | Error seeking in datastream
SDL_UNSUPPORTED | Unknown SDL error
SDL_LASTERROR | Unknown SDL error
any other value | Unknown SDL error
See also SDL_error.c. One of the wiki entries seems to be incorrect. The correct error code - error string pair would be:
SDL_UNSUPPORTED | That operation is not supported
You can set custom errors messages with SDL_SetError - see the .c above. Finally, "double free or corruption" is not an error caused by SDL, but most likely by a double free. I suggest gdb/valgrind to debug it.

Frama-c Assertion

Recently I have been working with frama-c and I have faced a problem which is a bit confusing.
I have written a very simple program in frama-c which is this:
void main(void)
{
int a = 3;
int b = 4;
/*# assert a == b;*/
}
I expect frama-c to say the assertion is not valid which in GUI this is shown by red bullet, but instead frama-c says the assertion is not valid according to value (under hypothesis), which is shown by orange-red bullet.
My question is why would frama-c say the assertion is not valid under hypothesis?
What are the possible hypotheses?
I am asking this because my program is very simple and I can't find any hypothesis or dependency in my program which is related to the assertion and I guess frama-c should just say the assertion is not valid.
If you have graphviz configured with your Frama-C installation (i.e. it was available when Frama-C was configured, either manually or via opam), you can double-click the property in the Properties panel, and a window should open with the following dependency graph for the property:
In it, we can see all the hypotheses used by a property, and so we see that the "under hypotheses" mentioned is that of the reachability of the assertion. Eva (value plug-in) computes an over-approximation of reachable states, so it cannot prove that a given state is reachable, only that it is unreachable.
Currently, the only plug-in which can definitely prove reachability statuses is PathCrawler. However, in practice this is rarely an issue.
An alternative way to see the dependencies of a property proven under hypotheses is to use the Report plugin, on the command-line:
$ frama-c -val c.c -then -report
[report] Computing properties status...
--------------------------------------------------------------------------------
--- Properties of Function 'main'
--------------------------------------------------------------------------------
[ Alarm ] Assertion (file c.c, line 5)
By Value, with pending:
- Unreachable program point (file c.c, line 5)
--------------------------------------------------------------------------------
--- Status Report Summary
--------------------------------------------------------------------------------
1 Alarm emitted
1 Total
--------------------------------------------------------------------------------
The pending information lists all the properties required to finish the proof. For statutes emitted by the Value/Eva plugin, the only dependences emitted will always be reachability ones.
(This is actually misleading: the status of the n th property actually depends on the statuses for the properties k with k < n. This would generate a dependency graph too big, so those dependencies are not tracked.)

Xscreensaver code giving BadMatch error

I've been able to hack an Xscreensaver to where I'm getting my desired look (big thanks to luser droog for his aid). I added in some Cairo code because it was difficult to implement what I wanted with Xlib alone. Since this is just a hack for me I don't intend on distributing it.
Anyway, when I preview Fuzzyflakes in a window it looks fine, yet when I preview it fullscreen (like any good screensaver) it gives me this error:
X error in fuzzyflakes:
X Error of failed request: BadMatch (invalid parameter attribute)
Major Optcode of failed request: 139 (RENDER)
Minor optcode of failed request: 4 (RenderCreatePicture)
Serial number of failed request: 528
Current serial number in output stream: 1654
Here's some further information. I'm using Linux Mint 14, 64-bit edition. I'm using the nVidia proprietary drivers, version 304.88. I had to hack the Makefile generated by the xscreensaver configure script. I changed line 800 of the Makefile to this:
fuzzyflakes: fuzzyflakes.o $(HACK_OBJS)
$(CC_HACK) `pkg-config --cflags cairo` -g -o $# $#.o $(HACK_OBJS) $(HACK_LIBS) -lcairo -lm
For the full source code you can look here.
From a quick look, it seems like you are feeding cairo with invalid information:
flake->Fluff.gradient_image_background =
cairo_xlib_surface_create(flake->dpy,
flake->DB.b, DefaultVisual(flake->dpy, 0),
flake->XGWA.width, flake->XGWA.height);
This claims that the drawable DB.p uses the display's first screen's default visual. However, the actual window seems to be an argument to fuzzyflakes_init() and thus could be using another visual.
From another quick look, please try replacing DefaultVisual(flake->dpy, 0) with flake->XGWA.visual.

Resources