Title: [153718] branches/safari-537-branch/Source/WebCore

Diff

Modified: branches/safari-537-branch/Source/WebCore/ChangeLog (153717 => 153718)


--- branches/safari-537-branch/Source/WebCore/ChangeLog	2013-08-05 19:31:38 UTC (rev 153717)
+++ branches/safari-537-branch/Source/WebCore/ChangeLog	2013-08-05 19:35:45 UTC (rev 153718)
@@ -1,5 +1,32 @@
 2013-08-05  Lucas Forschler  <lforsch...@apple.com>
 
+        Merge r152876
+
+    2013-07-18  Brent Fulgham  <bfulg...@apple.com>
+
+            [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-08-05  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r153628
 
     2013-08-01  Brent Fulgham  <bfulg...@apple.com>

Modified: branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (153717 => 153718)


--- branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2013-08-05 19:31:38 UTC (rev 153717)
+++ branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2013-08-05 19:35:45 UTC (rev 153718)
@@ -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: branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (153717 => 153718)


--- branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2013-08-05 19:31:38 UTC (rev 153717)
+++ branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2013-08-05 19:35:45 UTC (rev 153718)
@@ -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: branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (153717 => 153718)


--- branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2013-08-05 19:31:38 UTC (rev 153717)
+++ branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2013-08-05 19:35:45 UTC (rev 153718)
@@ -948,16 +948,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()
 {
@@ -1000,32 +990,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: branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (153717 => 153718)


--- branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h	2013-08-05 19:31:38 UTC (rev 153717)
+++ branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h	2013-08-05 19:35:45 UTC (rev 153718)
@@ -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: branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (153717 => 153718)


--- branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2013-08-05 19:31:38 UTC (rev 153717)
+++ branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2013-08-05 19:35:45 UTC (rev 153718)
@@ -177,8 +177,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: branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (153717 => 153718)


--- branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2013-08-05 19:31:38 UTC (rev 153717)
+++ branches/safari-537-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2013-08-05 19:35:45 UTC (rev 153718)
@@ -1334,17 +1334,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()
 {
@@ -1383,32 +1372,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()
 {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to