Changeset 175526 in webkit
- Timestamp:
- Nov 4, 2014 1:29:13 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r175525 r175526 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 -
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
r175400 r175526 126 126 virtual std::unique_ptr<PlatformTimeRanges> buffered() const { return PlatformTimeRanges::create(); } 127 127 128 virtual unsigned totalBytes() const { return 0; }128 virtual unsigned long long totalBytes() const { return 0; } 129 129 virtual bool didLoadingProgress() const { return false; } 130 130 -
trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h
r173931 r175526 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 … … 241 242 virtual String languageOfPrimaryAudioTrack() const { return emptyString(); } 242 243 243 virtual size_t extraMemoryCost() const { return 0; } 244 244 virtual size_t extraMemoryCost() const 245 { 246 MediaTime duration = this->durationMediaTime(); 247 if (!duration) 248 return 0; 249 250 unsigned long long extra = totalBytes() * buffered()->totalDuration().toDouble() / duration.toDouble(); 251 return static_cast<unsigned>(extra); 252 } 253 245 254 virtual unsigned long long fileSize() const { return 0; } 246 255 -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
r174563 r175526 946 946 } 947 947 948 size_t MediaPlayerPrivateAVFoundation::extraMemoryCost() const949 {950 MediaTime duration = this->durationMediaTime();951 if (!duration)952 return 0;953 954 unsigned long long extra = totalBytes() * buffered()->totalDuration().toDouble() / duration.toDouble();955 return static_cast<unsigned>(extra);956 }957 958 948 void MediaPlayerPrivateAVFoundation::clearTextTracks() 959 949 { -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
r173318 r175526 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) -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r174563 r175526 211 211 , m_hasVideo(false) 212 212 , m_hasAudio(false) 213 , m_totalBytes( -1)213 , m_totalBytes(0) 214 214 , m_preservesPitch(false) 215 215 , m_requestedState(GST_STATE_VOID_PENDING) … … 1228 1228 } 1229 1229 1230 unsigned MediaPlayerPrivateGStreamer::totalBytes() const1230 unsigned long long MediaPlayerPrivateGStreamer::totalBytes() const 1231 1231 { 1232 1232 if (m_errorOccured) 1233 1233 return 0; 1234 1234 1235 if (m_totalBytes != -1)1235 if (m_totalBytes) 1236 1236 return m_totalBytes; 1237 1237 … … 1243 1243 if (gst_element_query_duration(m_source.get(), fmt, &length)) { 1244 1244 INFO_MEDIA_MESSAGE("totalBytes %" G_GINT64_FORMAT, length); 1245 m_totalBytes = static_cast<unsigned >(length);1245 m_totalBytes = static_cast<unsigned long long>(length); 1246 1246 m_isStreaming = !length; 1247 1247 return m_totalBytes; … … 1278 1278 1279 1279 INFO_MEDIA_MESSAGE("totalBytes %" G_GINT64_FORMAT, length); 1280 m_totalBytes = static_cast<unsigned >(length);1280 m_totalBytes = static_cast<unsigned long long>(length); 1281 1281 m_isStreaming = !length; 1282 1282 return m_totalBytes; -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r174632 r175526 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; -
trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
r174106 r175526 119 119 MediaTime maxMediaTimeSeekable() const; 120 120 bool didLoadingProgress() const; 121 unsigned totalBytes() const;121 unsigned long long totalBytes() const; 122 122 123 123 void setVisible(bool); -
trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
r175131 r175526 872 872 } 873 873 874 unsigned MediaPlayerPrivateQTKit::totalBytes() const874 unsigned long long MediaPlayerPrivateQTKit::totalBytes() const 875 875 { 876 876 if (!metaDataAvailable()) 877 877 return 0; 878 return [[m_qtMovie.get() attributeForKey:QTMovieDataSizeAttribute] intValue];878 return [[m_qtMovie.get() attributeForKey:QTMovieDataSizeAttribute] longLongValue]; 879 879 } 880 880
Note: See TracChangeset
for help on using the changeset viewer.