Changeset 175945 in webkit
- Timestamp:
- Nov 11, 2014, 9:32:40 AM (12 years ago)
- Location:
- releases/WebKitGTK/webkit-2.6/Source/WebCore
- Files:
-
- 9 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/MediaPlayer.cpp (modified) (1 diff)
-
platform/graphics/MediaPlayerPrivate.h (modified) (2 diffs)
-
platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (modified) (1 diff)
-
platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (modified) (1 diff)
-
platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (modified) (4 diffs)
-
platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (modified) (2 diffs)
-
platform/graphics/mac/MediaPlayerPrivateQTKit.h (modified) (1 diff)
-
platform/graphics/mac/MediaPlayerPrivateQTKit.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog
r175944 r175945 1 2014-11-03 Philippe Normand <pnormand@igalia.com> 2 3 [LEAK] [GStreamer] Removing video element will not free assigned memory 4 https://bugs.webkit.org/show_bug.cgi?id=46560 5 6 Reviewed by Eric Carlson. 7 8 Moved the ::extraMemoryCost() implementation to the 9 MediaPlayerPivateInterface base class. This default implementation 10 is now shared between the various MediaPlayerPrivate backends, 11 excepted the AVF MediaSource player which still reports no extra 12 memory cost. 13 14 * platform/graphics/MediaPlayerPrivate.h: 15 (WebCore::MediaPlayerPrivateInterface::totalBytes): Make 16 totalBytes() part of the MediaPlayerPrivate interface. 17 (WebCore::MediaPlayerPrivateInterface::extraMemoryCost): Default 18 implementation. 19 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: 20 (WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): Deleted. 21 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: 22 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 23 1 24 2014-11-04 Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> 2 25 -
releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/MediaPlayer.cpp
r173318 r175945 131 131 virtual std::unique_ptr<PlatformTimeRanges> buffered() const { return PlatformTimeRanges::create(); } 132 132 133 virtual unsigned totalBytes() const { return 0; }133 virtual unsigned long long totalBytes() const { return 0; } 134 134 virtual bool didLoadingProgress() const { return false; } 135 135 -
releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/MediaPlayerPrivate.h
r173318 r175945 131 131 virtual std::unique_ptr<PlatformTimeRanges> buffered() const = 0; 132 132 133 virtual unsigned long long totalBytes() const { return 0; } 133 134 virtual bool didLoadingProgress() const = 0; 134 135 … … 243 244 virtual String languageOfPrimaryAudioTrack() const { return emptyString(); } 244 245 245 virtual size_t extraMemoryCost() const { return 0; } 246 246 virtual size_t extraMemoryCost() const 247 { 248 MediaTime duration = this->durationMediaTime(); 249 if (!duration) 250 return 0; 251 252 unsigned long long extra = totalBytes() * buffered()->totalDuration().toDouble() / duration.toDouble(); 253 return static_cast<unsigned>(extra); 254 } 255 247 256 virtual unsigned long long fileSize() const { return 0; } 248 257 -
releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
r173453 r175945 948 948 } 949 949 950 size_t MediaPlayerPrivateAVFoundation::extraMemoryCost() const951 {952 MediaTime duration = this->durationMediaTime();953 if (!duration)954 return 0;955 956 unsigned long long extra = totalBytes() * buffered()->totalDuration().toDouble() / duration.toDouble();957 return static_cast<unsigned>(extra);958 }959 960 950 void MediaPlayerPrivateAVFoundation::clearTextTracks() 961 951 { -
releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
r173318 r175945 293 293 virtual String engineDescription() const { return "AVFoundation"; } 294 294 295 virtual size_t extraMemoryCost() const override;296 297 295 virtual void trackModeChanged() override; 298 296 #if ENABLE(AVF_CAPTIONS) -
releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r173318 r175945 212 212 , m_hasVideo(false) 213 213 , m_hasAudio(false) 214 , m_totalBytes( -1)214 , m_totalBytes(0) 215 215 , m_preservesPitch(false) 216 216 , m_requestedState(GST_STATE_VOID_PENDING) … … 1229 1229 } 1230 1230 1231 unsigned MediaPlayerPrivateGStreamer::totalBytes() const1231 unsigned long long MediaPlayerPrivateGStreamer::totalBytes() const 1232 1232 { 1233 1233 if (m_errorOccured) 1234 1234 return 0; 1235 1235 1236 if (m_totalBytes != -1)1236 if (m_totalBytes) 1237 1237 return m_totalBytes; 1238 1238 … … 1244 1244 if (gst_element_query_duration(m_source.get(), fmt, &length)) { 1245 1245 INFO_MEDIA_MESSAGE("totalBytes %" G_GINT64_FORMAT, length); 1246 m_totalBytes = static_cast<unsigned >(length);1246 m_totalBytes = static_cast<unsigned long long>(length); 1247 1247 m_isStreaming = !length; 1248 1248 return m_totalBytes; … … 1279 1279 1280 1280 INFO_MEDIA_MESSAGE("totalBytes %" G_GINT64_FORMAT, length); 1281 m_totalBytes = static_cast<unsigned >(length);1281 m_totalBytes = static_cast<unsigned long long>(length); 1282 1282 m_isStreaming = !length; 1283 1283 return m_totalBytes; -
releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r174638 r175945 93 93 float maxTimeSeekable() const; 94 94 bool didLoadingProgress() const; 95 unsigned totalBytes() const;95 unsigned long long totalBytes() const; 96 96 float maxTimeLoaded() const; 97 97 … … 208 208 GThreadSafeMainLoopSource m_videoCapsTimerHandler; 209 209 GThreadSafeMainLoopSource m_readyTimerHandler; 210 mutable long m_totalBytes;210 mutable unsigned long long m_totalBytes; 211 211 URL m_url; 212 212 bool m_preservesPitch; -
releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
r173318 r175945 124 124 MediaTime maxMediaTimeSeekable() const; 125 125 bool didLoadingProgress() const; 126 unsigned totalBytes() const;126 unsigned long long totalBytes() const; 127 127 128 128 void setVisible(bool); -
releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
r173318 r175945 979 979 } 980 980 981 unsigned MediaPlayerPrivateQTKit::totalBytes() const981 unsigned long long MediaPlayerPrivateQTKit::totalBytes() const 982 982 { 983 983 if (!metaDataAvailable()) 984 984 return 0; 985 return [[m_qtMovie.get() attributeForKey:QTMovieDataSizeAttribute] intValue];985 return [[m_qtMovie.get() attributeForKey:QTMovieDataSizeAttribute] longLongValue]; 986 986 } 987 987
Note:
See TracChangeset
for help on using the changeset viewer.