Diff
Modified: trunk/Source/WebCore/ChangeLog (152875 => 152876)
--- trunk/Source/WebCore/ChangeLog 2013-07-19 01:06:46 UTC (rev 152875)
+++ trunk/Source/WebCore/ChangeLog 2013-07-19 01:08:42 UTC (rev 152876)
@@ -1,3 +1,26 @@
+2013-07-18 Brent Fulgham <[email protected]>
+
+ [Media] Share more code between Mac and Windows implementation files.
+ https://bugs.webkit.org/show_bug.cgi?id=118801
+
+ Reviewed by Eric Carlson.
+
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundation::clearTextTracks): Move
+ implementation from ObjC file to parent file.
+ (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
+ Ditto.
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+ Remove duplicate implementation.
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ Ditto.
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
+ Ditto.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+ Ditto.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ Ditto.
+
2013-07-18 Alex Christensen <[email protected]>
Fixed compile errors for non-Cairo platforms using EGL.
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (152875 => 152876)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2013-07-19 01:06:46 UTC (rev 152875)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2013-07-19 01:08:42 UTC (rev 152876)
@@ -873,6 +873,41 @@
return totalBytes() * buffered()->totalDuration() / duration;
}
+void MediaPlayerPrivateAVFoundation::clearTextTracks()
+{
+ for (unsigned i = 0; i < m_textTracks.size(); ++i) {
+ RefPtr<InbandTextTrackPrivateAVF> track = m_textTracks[i];
+ player()->removeTextTrack(track);
+ track->disconnect();
+ }
+ m_textTracks.clear();
+}
+
+void MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks(const Vector<RefPtr<InbandTextTrackPrivateAVF> >& removedTextTracks)
+{
+ if (removedTextTracks.size()) {
+ for (unsigned i = 0; i < m_textTracks.size(); ++i) {
+ if (!removedTextTracks.contains(m_textTracks[i]))
+ continue;
+
+ player()->removeTextTrack(removedTextTracks[i].get());
+ m_textTracks.remove(i);
+ }
+ }
+
+ for (unsigned i = 0; i < m_textTracks.size(); ++i) {
+ RefPtr<InbandTextTrackPrivateAVF> track = m_textTracks[i];
+
+ track->setTextTrackIndex(i);
+ if (track->hasBeenReported())
+ continue;
+
+ track->setHasBeenReported(true);
+ player()->addTextTrack(track.get());
+ }
+ LOG(Media, "MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks(%p) - found %i text tracks", this, m_textTracks.size());
+}
+
} // namespace WebCore
#endif
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (152875 => 152876)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h 2013-07-19 01:06:46 UTC (rev 152875)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h 2013-07-19 01:08:42 UTC (rev 152876)
@@ -250,7 +250,7 @@
virtual void setUpVideoRendering();
virtual void tearDownVideoRendering();
bool hasSetUpVideoRendering() const;
-
+
static void mainThreadCallback(void*);
void invalidateCachedDuration();
@@ -264,6 +264,8 @@
virtual size_t extraMemoryCost() const OVERRIDE;
virtual void trackModeChanged() OVERRIDE;
+ void processNewAndRemovedTextTracks(const Vector<RefPtr<InbandTextTrackPrivateAVF> >&);
+ void clearTextTracks();
Vector<RefPtr<InbandTextTrackPrivateAVF> > m_textTracks;
private:
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (152875 => 152876)
--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2013-07-19 01:06:46 UTC (rev 152875)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2013-07-19 01:08:42 UTC (rev 152876)
@@ -946,16 +946,6 @@
setNaturalSize(IntSize(naturalSize));
}
-void MediaPlayerPrivateAVFoundationCF::clearTextTracks()
-{
- for (unsigned i = 0; i < m_textTracks.size(); ++i) {
- RefPtr<InbandTextTrackPrivateAVF> track = m_textTracks[i];
- player()->removeTextTrack(track);
- track->disconnect();
- }
- m_textTracks.clear();
-}
-
#if !HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
void MediaPlayerPrivateAVFoundationCF::processLegacyClosedCaptionsTracks()
{
@@ -998,32 +988,6 @@
}
#endif
-void MediaPlayerPrivateAVFoundationCF::processNewAndRemovedTextTracks(const Vector<RefPtr<InbandTextTrackPrivateAVF> >& removedTextTracks)
-{
- // FIXME: Lift to parent class (https://bugs.webkit.org/show_bug.cgi?id=118801)
- if (removedTextTracks.size()) {
- for (unsigned i = 0; i < m_textTracks.size(); ++i) {
- if (!removedTextTracks.contains(m_textTracks[i]))
- continue;
-
- player()->removeTextTrack(removedTextTracks[i].get());
- m_textTracks.remove(i);
- }
- }
-
- for (unsigned i = 0; i < m_textTracks.size(); ++i) {
- RefPtr<InbandTextTrackPrivateAVF> track = m_textTracks[i];
-
- track->setTextTrackIndex(i);
- if (track->hasBeenReported())
- continue;
-
- track->setHasBeenReported(true);
- player()->addTextTrack(track.get());
- }
- LOG(Media, "MediaPlayerPrivateAVFoundationCF::processNewAndRemovedTextTracks(%p) - found %i text tracks", this, m_textTracks.size());
-}
-
#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
void MediaPlayerPrivateAVFoundationCF::processMediaSelectionOptions()
{
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (152875 => 152876)
--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h 2013-07-19 01:06:46 UTC (rev 152875)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h 2013-07-19 01:08:42 UTC (rev 152876)
@@ -107,8 +107,6 @@
virtual void setCurrentTrack(InbandTextTrackPrivateAVF*) OVERRIDE;
virtual InbandTextTrackPrivateAVF* currentTrack() const OVERRIDE;
- void processNewAndRemovedTextTracks(const Vector<RefPtr<InbandTextTrackPrivateAVF> >&);
- void clearTextTracks();
#if !HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
void processLegacyClosedCaptionsTracks();
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (152875 => 152876)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h 2013-07-19 01:06:46 UTC (rev 152875)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h 2013-07-19 01:08:42 UTC (rev 152876)
@@ -175,8 +175,6 @@
virtual void setCurrentTrack(InbandTextTrackPrivateAVF*) OVERRIDE;
virtual InbandTextTrackPrivateAVF* currentTrack() const OVERRIDE { return m_currentTrack; }
- void processNewAndRemovedTextTracks(const Vector<RefPtr<InbandTextTrackPrivateAVF> >&);
- void clearTextTracks();
#if !HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
void processLegacyClosedCaptionsTracks();
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (152875 => 152876)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2013-07-19 01:06:46 UTC (rev 152875)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2013-07-19 01:08:42 UTC (rev 152876)
@@ -1326,17 +1326,6 @@
}
#endif
-
-void MediaPlayerPrivateAVFoundationObjC::clearTextTracks()
-{
- for (unsigned i = 0; i < m_textTracks.size(); ++i) {
- RefPtr<InbandTextTrackPrivateAVF> track = m_textTracks[i];
- player()->removeTextTrack(track);
- track->disconnect();
- }
- m_textTracks.clear();
-}
-
#if !HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
void MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks()
{
@@ -1375,32 +1364,6 @@
}
#endif
-void MediaPlayerPrivateAVFoundationObjC::processNewAndRemovedTextTracks(const Vector<RefPtr<InbandTextTrackPrivateAVF> >& removedTextTracks)
-{
- if (removedTextTracks.size()) {
- for (unsigned i = 0; i < m_textTracks.size(); ++i) {
- if (!removedTextTracks.contains(m_textTracks[i]))
- continue;
-
- player()->removeTextTrack(removedTextTracks[i].get());
- m_textTracks.remove(i);
- }
- }
-
- for (unsigned i = 0; i < m_textTracks.size(); ++i) {
- RefPtr<InbandTextTrackPrivateAVF> track = m_textTracks[i];
-
- track->setTextTrackIndex(i);
- if (track->hasBeenReported())
- continue;
-
- track->setHasBeenReported(true);
- player()->addTextTrack(track.get());
- }
- LOG(Media, "MediaPlayerPrivateAVFoundationObjC::processNewAndRemovedTextTracks(%p) - found %i text tracks", this, m_textTracks.size());
-
-}
-
#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
AVMediaSelectionGroupType* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia()
{