[Bug 780923] New: Various combined-flag #defines are not C++ friendly

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Apr 5 11:09:02 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=780923

            Bug ID: 780923
           Summary: Various combined-flag #defines are not C++ friendly
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: slomo at coaxion.net
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

In core, the following at least. A C++ compiler will complain that the result
of the |-combination is not part of the enum (correctly!). Some other cases of
such #defines are explicitly casting to the target type because of that (e.g.
GST_BUFFER_COPY_ALL).

I would suggest to do the same for the other ones (and we should also check
-base and -bad libs).


gst/gstpad.c:#define _PAD_PROBE_TYPE_ALL_BOTH_AND_FLUSH
(GST_PAD_PROBE_TYPE_ALL_BOTH | GST_PAD_PROBE_TYPE_EVENT_FLUSH)

gst/gstminiobject.h:#define GST_LOCK_FLAG_READWRITE  (GST_LOCK_FLAG_READ |
GST_LOCK_FLAG_WRITE)

gst/gstmemory.h:#define GST_MAP_READWRITE      (GST_MAP_READ | GST_MAP_WRITE)

gst/gstbuffer.h:#define GST_BUFFER_COPY_METADATA       (GST_BUFFER_COPY_FLAGS |
GST_BUFFER_COPY_TIMESTAMPS |\

gst/gstelementfactory.h:#define GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER
(GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO |
GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)
gst/gstelementfactory.h:#define GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER
(GST_ELEMENT_FACTORY_TYPE_ENCODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO)
gst/gstelementfactory.h:#define GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS
(GST_ELEMENT_FACTORY_TYPE_SINK | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO |
GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO | GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list