Changeset 109933 in webkit
- Timestamp:
- Mar 6, 2012 10:15:00 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109932 r109933 1 2012-03-06 David Corvoysier <david.corvoysier@orange.com> 2 3 Unreleased gst_object_reference to audio sink in MediaPlayerPrivateGStreamer 4 https://bugs.webkit.org/show_bug.cgi?id=79795 5 6 Bug fix: Used a GRefPtr to hold the reference to the audio sink instead of a GstElement*. 7 Code cleanup: Used the same pattern for webkit web source and removed explicit gst_unref in destructor. 8 9 Reviewed by Philippe Normand. 10 11 No new tests. No change in behavior. 12 13 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 14 (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): 15 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 16 (MediaPlayerPrivateGStreamer): 17 1 18 2012-03-06 Patrick Gansterer <paroga@webkit.org> 2 19 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r109915 r109933 31 31 #include "Frame.h" 32 32 #include "FrameView.h" 33 #include "GRefPtrGStreamer.h"34 33 #include "GStreamerGWorld.h" 35 34 #include "GStreamerVersioning.h" … … 263 262 } 264 263 265 if (m_source) {266 gst_object_unref(m_source);267 m_source = 0;268 }269 270 264 if (m_videoSinkBin) { 271 265 gst_object_unref(m_videoSinkBin); … … 959 953 gint64 length = 0; 960 954 #ifdef GST_API_VERSION_1 961 if (gst_element_query_duration(m_source , fmt, &length)) {955 if (gst_element_query_duration(m_source.get(), fmt, &length)) { 962 956 #else 963 if (gst_element_query_duration(m_source , &fmt, &length)) {957 if (gst_element_query_duration(m_source.get(), &fmt, &length)) { 964 958 #endif 965 959 LOG_VERBOSE(Media, "totalBytes %" G_GINT64_FORMAT, length); … … 969 963 // Fall back to querying the source pads manually. 970 964 // See also https://bugzilla.gnome.org/show_bug.cgi?id=638749 971 GstIterator* iter = gst_element_iterate_src_pads(m_source );965 GstIterator* iter = gst_element_iterate_src_pads(m_source.get()); 972 966 bool done = false; 973 967 while (!done) { … … 1037 1031 gint64 position = 0; 1038 1032 1039 if (m_webkitAudioSink && gst_element_query(m_webkitAudioSink , query))1033 if (m_webkitAudioSink && gst_element_query(m_webkitAudioSink.get(), query)) 1040 1034 gst_query_parse_position(query, 0, &position); 1041 1035 … … 1061 1055 return; 1062 1056 1063 GRefPtr<GstElement> element;1064 1057 GstElement* sinkPtr = 0; 1065 1058 1066 1059 g_object_get(m_playBin, "audio-sink", &sinkPtr, NULL); 1067 element = adoptGRef(sinkPtr); 1068 1069 gst_object_replace(reinterpret_cast<GstObject**>(&m_webkitAudioSink), 1070 reinterpret_cast<GstObject*>(element.get())); 1060 m_webkitAudioSink = adoptGRef(sinkPtr); 1061 1071 1062 } 1072 1063 … … 1074 1065 void MediaPlayerPrivateGStreamer::sourceChanged() 1075 1066 { 1076 GRefPtr<GstElement> element;1077 1067 GstElement* srcPtr = 0; 1078 1068 1079 1069 g_object_get(m_playBin, "source", &srcPtr, NULL); 1080 element = adoptGRef(srcPtr); 1081 1082 gst_object_replace(reinterpret_cast<GstObject**>(&m_source), 1083 reinterpret_cast<GstObject*>(element.get())); 1084 1085 if (WEBKIT_IS_WEB_SRC(element.get())) 1086 webKitWebSrcSetMediaPlayer(WEBKIT_WEB_SRC(element.get()), m_player); 1070 m_source = adoptGRef(srcPtr); 1071 1072 if (WEBKIT_IS_WEB_SRC(m_source.get())) 1073 webKitWebSrcSetMediaPlayer(WEBKIT_WEB_SRC(m_source.get()), m_player); 1087 1074 } 1088 1075 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r109915 r109933 25 25 #if ENABLE(VIDEO) && USE(GSTREAMER) 26 26 27 #include <wtf/Forward.h>27 #include "GRefPtrGStreamer.h" 28 28 #include "MediaPlayerPrivate.h" 29 29 #include "Timer.h" … … 31 31 #include <glib.h> 32 32 #include <gst/gst.h> 33 #include <wtf/Forward.h> 33 34 34 35 typedef struct _WebKitVideoSink WebKitVideoSink; … … 155 156 GstElement* m_videoSinkBin; 156 157 GstElement* m_fpsSink; 157 G stElement*m_source;158 GRefPtr<GstElement> m_source; 158 159 float m_seekTime; 159 160 bool m_changingRate; … … 190 191 guint m_audioTimerHandler; 191 192 guint m_videoTimerHandler; 192 G stElement*m_webkitAudioSink;193 GRefPtr<GstElement> m_webkitAudioSink; 193 194 }; 194 195 }
Note: See TracChangeset
for help on using the changeset viewer.