mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
gl: examples: fix c++ code for -Wreturn-aggregate
.. and use #ifdef instead of #if
This commit is contained in:
parent
26b3955aba
commit
0eefcb23b4
3 changed files with 7 additions and 9 deletions
|
@ -73,10 +73,9 @@ static void identityCallback (GstElement *src, GstBuffer *buffer, GstElement* t
|
|||
nbFrames++ ;
|
||||
if (GST_BUFFER_TIMESTAMP(buffer) - last_timestamp >= 1000000000)
|
||||
{
|
||||
std::ostringstream oss ;
|
||||
oss << "video framerate = " << nbFrames ;
|
||||
std::string s(oss.str()) ;
|
||||
g_object_set(G_OBJECT(textoverlay), "text", s.c_str(), NULL);
|
||||
gchar *s = g_strdup_printf ("video framerate = %d", nbFrames);
|
||||
g_object_set(G_OBJECT(textoverlay), "text", s, NULL);
|
||||
g_free (s);
|
||||
last_timestamp = GST_BUFFER_TIMESTAMP(buffer) ;
|
||||
nbFrames = 0 ;
|
||||
}
|
||||
|
|
|
@ -73,10 +73,9 @@ static GstPadProbeReturn textoverlay_sink_pad_probe_cb (GstPad *pad, GstPadProbe
|
|||
nbFrames++ ;
|
||||
if (GST_BUFFER_TIMESTAMP(info->data) - last_timestamp >= 1000000000)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "video framerate = " << nbFrames ;
|
||||
std::string s(oss.str());
|
||||
g_object_set(G_OBJECT(textoverlay), "text", s.c_str(), NULL);
|
||||
gchar *s = g_strdup_printf ("video framerate = %d", nbFrames);
|
||||
g_object_set(G_OBJECT(textoverlay), "text", s, NULL);
|
||||
g_free (s);
|
||||
last_timestamp = GST_BUFFER_TIMESTAMP(info->data) ;
|
||||
nbFrames = 0;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <GL/gl.h>
|
||||
#if __WIN32__ || _WIN32
|
||||
#if defined(__WIN32__) || defined(_WIN32)
|
||||
# include <GL/glext.h>
|
||||
#endif
|
||||
#include <gst/gst.h>
|
||||
|
|
Loading…
Reference in a new issue