Bug 159250 - Adopt MediaRemote.
Summary: Adopt MediaRemote.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-29 00:06 PDT by Jer Noble
Modified: 2016-10-31 09:16 PDT (History)
6 users (show)

See Also:


Attachments
WIP (59.98 KB, patch)
2016-06-29 00:32 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
WIP (62.98 KB, patch)
2016-06-29 08:19 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (62.03 KB, patch)
2016-06-29 08:49 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (61.70 KB, patch)
2016-06-29 08:51 PDT, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff
Patch for landing (63.23 KB, patch)
2016-06-29 09:34 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (61.72 KB, patch)
2016-06-29 09:36 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2016-06-29 00:06:55 PDT
Adopt MediaRemote.
Comment 1 Jer Noble 2016-06-29 00:32:39 PDT
Created attachment 282329 [details]
WIP
Comment 2 Eric Carlson 2016-06-29 08:12:39 PDT
Comment on attachment 282329 [details]
WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=282329&action=review

> Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1589
> -        m_buffered->add(presentationTimestamp.toDouble(), (presentationTimestamp + frameDuration + microsecond).toDouble());
> +        m_buffered->add(presentationTimestamp.toDouble(), (presentationTimestamp + frameDuration).toDouble());

Is this related?

> Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm:2
> + * Copyright (C) 2014-2015 Apple Inc. All rights reserved.

Nit: 2014-2015 -> 2016.

> Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm:156
> +    if (std::isfinite(duration) && duration != MediaPlayer::invalidTime())
> +        CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoDuration, cfDuration.get());

Nit: you don't need to create the CFNumber unless it will be added to the info dictionary.

> Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm:163
> +        CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoElapsedTime, cfCurrentTime.get());

Ditto.

> Source/WebCore/platform/mac/RemoteCommandListenerMac.mm:60
> +    auto commandInfoArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, sizeof(supportedCommands) / sizeof(MRMediaRemoteCommand), &kCFTypeArrayCallBacks));

You can use ARRAY_SIZE here.
Comment 3 Jer Noble 2016-06-29 08:19:31 PDT
Created attachment 282347 [details]
WIP
Comment 4 Eric Carlson 2016-06-29 08:24:36 PDT
Comment on attachment 282347 [details]
WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=282347&action=review

> Source/WebCore/platform/mac/RemoteCommandListenerMac.h:27
> +#ifndef RemoteCommandListenerMac_h
> +#define RemoteCommandListenerMac_h

Nit: this can use "#pragma once"
Comment 5 Jer Noble 2016-06-29 08:49:40 PDT
(In reply to comment #2)
> Comment on attachment 282329 [details]
> WIP
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=282329&action=review
> 
> > Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1589
> > -        m_buffered->add(presentationTimestamp.toDouble(), (presentationTimestamp + frameDuration + microsecond).toDouble());
> > +        m_buffered->add(presentationTimestamp.toDouble(), (presentationTimestamp + frameDuration).toDouble());
> 
> Is this related?

Whoops. Nope.

> > Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm:2
> > + * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
> 
> Nit: 2014-2015 -> 2016.

Ok.

> > Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm:156
> > +    if (std::isfinite(duration) && duration != MediaPlayer::invalidTime())
> > +        CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoDuration, cfDuration.get());
> 
> Nit: you don't need to create the CFNumber unless it will be added to the
> info dictionary.
> 
> > Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm:163
> > +        CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoElapsedTime, cfCurrentTime.get());
> 
> Ditto.
> 
> > Source/WebCore/platform/mac/RemoteCommandListenerMac.mm:60
> > +    auto commandInfoArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, sizeof(supportedCommands) / sizeof(MRMediaRemoteCommand), &kCFTypeArrayCallBacks));
> 
> You can use ARRAY_SIZE here.

Ok.

(In reply to comment #4)
> Comment on attachment 282347 [details]
> WIP
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=282347&action=review
> 
> > Source/WebCore/platform/mac/RemoteCommandListenerMac.h:27
> > +#ifndef RemoteCommandListenerMac_h
> > +#define RemoteCommandListenerMac_h
> 
> Nit: this can use "#pragma once"

Ok.
Comment 6 Jer Noble 2016-06-29 08:49:51 PDT
Created attachment 282348 [details]
Patch
Comment 7 Jer Noble 2016-06-29 08:51:36 PDT
Created attachment 282349 [details]
Patch
Comment 8 Jer Noble 2016-06-29 09:34:12 PDT
Created attachment 282351 [details]
Patch for landing
Comment 9 Jer Noble 2016-06-29 09:36:43 PDT
Created attachment 282353 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2016-06-29 12:29:31 PDT
Comment on attachment 282353 [details]
Patch for landing

Clearing flags on attachment: 282353

Committed r202642: <http://trac.webkit.org/changeset/202642>
Comment 11 Radar WebKit Bug Importer 2016-06-29 15:04:54 PDT
<rdar://problem/27090091>
Comment 12 Hunseop Jeong 2016-06-29 19:26:06 PDT
CMake build fix.
Committed r202661: <http://trac.webkit.org/changeset/202661>
Committed r202662: <http://trac.webkit.org/changeset/202662>