Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
19c88583
authored
Feb 10, 2020
by
aquilescanta
Committed by
Oliver Woodman
Feb 13, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Prepare and release DrmSessionManager in Renderers
Issue: #6951 PiperOrigin-RevId: 294187695
parent
67a748f4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
3 deletions
RELEASENOTES.md
demos/main/src/main/assets/media.exolist.json
library/core/src/main/java/com/google/android/exoplayer2/audio/SimpleDecoderAudioRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/video/SimpleDecoderVideoRenderer.java
RELEASENOTES.md
View file @
19c88583
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
[
#6798
](
https://github.com/google/ExoPlayer/issues/6798
)
).
[
#6798
](
https://github.com/google/ExoPlayer/issues/6798
)
).
*
Fix
`DownloadHelper.createMediaSource`
to use
`customCacheKey`
when creating
*
Fix
`DownloadHelper.createMediaSource`
to use
`customCacheKey`
when creating
`ProgressiveMediaSource`
instances.
`ProgressiveMediaSource`
instances.
*
DRM: Fix
`NullPointerException`
when playing DRM-protected content
(
[
#6951
](
https://github.com/google/ExoPlayer/issues/6951
)
).
*
Metadata:
*
Metadata:
*
Update
`IcyDecoder`
to try ISO-8859-1 decoding if UTF-8 decoding fails.
*
Update
`IcyDecoder`
to try ISO-8859-1 decoding if UTF-8 decoding fails.
Also change
`IcyInfo.rawMetadata`
from
`String`
to
`byte[]`
to allow
Also change
`IcyInfo.rawMetadata`
from
`String`
to
`byte[]`
to allow
...
...
demos/main/src/main/assets/media.exolist.json
View file @
19c88583
...
@@ -3,9 +3,8 @@
...
@@ -3,9 +3,8 @@
"name"
:
"YouTube DASH"
,
"name"
:
"YouTube DASH"
,
"samples"
:
[
"samples"
:
[
{
{
"name"
:
"Google Glass (MP4,H264)"
,
"name"
:
"6956"
,
"uri"
:
"https://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,source,id,as&ip=0.0.0.0&ipbits=0&expire=19000000000&signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E&key=ik0"
,
"uri"
:
"http://master255.org/res/%d0%9a%d0%bb%d0%b8%d0%bf%d1%8b/B/Billy%20Mack/Billy%20Mack%20-%20Christmas%20Is%20All%20Around.mpg"
"extension"
:
"mpd"
},
},
{
{
"name"
:
"Google Play (MP4,H264)"
,
"name"
:
"Google Play (MP4,H264)"
,
...
...
library/core/src/main/java/com/google/android/exoplayer2/audio/SimpleDecoderAudioRenderer.java
View file @
19c88583
...
@@ -97,6 +97,7 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
...
@@ -97,6 +97,7 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
private
final
AudioSink
audioSink
;
private
final
AudioSink
audioSink
;
private
final
DecoderInputBuffer
flagsOnlyBuffer
;
private
final
DecoderInputBuffer
flagsOnlyBuffer
;
private
boolean
drmResourcesAcquired
;
private
DecoderCounters
decoderCounters
;
private
DecoderCounters
decoderCounters
;
private
Format
inputFormat
;
private
Format
inputFormat
;
private
int
encoderDelay
;
private
int
encoderDelay
;
...
@@ -539,6 +540,10 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
...
@@ -539,6 +540,10 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
@Override
@Override
protected
void
onEnabled
(
boolean
joining
)
throws
ExoPlaybackException
{
protected
void
onEnabled
(
boolean
joining
)
throws
ExoPlaybackException
{
if
(
drmSessionManager
!=
null
&&
!
drmResourcesAcquired
)
{
drmResourcesAcquired
=
true
;
drmSessionManager
.
prepare
();
}
decoderCounters
=
new
DecoderCounters
();
decoderCounters
=
new
DecoderCounters
();
eventDispatcher
.
enabled
(
decoderCounters
);
eventDispatcher
.
enabled
(
decoderCounters
);
int
tunnelingAudioSessionId
=
getConfiguration
().
tunnelingAudioSessionId
;
int
tunnelingAudioSessionId
=
getConfiguration
().
tunnelingAudioSessionId
;
...
@@ -588,6 +593,14 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
...
@@ -588,6 +593,14 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
}
}
@Override
@Override
protected
void
onReset
()
{
if
(
drmSessionManager
!=
null
&&
drmResourcesAcquired
)
{
drmResourcesAcquired
=
false
;
drmSessionManager
.
release
();
}
}
@Override
public
void
handleMessage
(
int
messageType
,
@Nullable
Object
message
)
throws
ExoPlaybackException
{
public
void
handleMessage
(
int
messageType
,
@Nullable
Object
message
)
throws
ExoPlaybackException
{
switch
(
messageType
)
{
switch
(
messageType
)
{
case
C
.
MSG_SET_VOLUME
:
case
C
.
MSG_SET_VOLUME
:
...
...
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java
View file @
19c88583
...
@@ -325,6 +325,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
...
@@ -325,6 +325,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
private
final
ArrayList
<
Long
>
decodeOnlyPresentationTimestamps
;
private
final
ArrayList
<
Long
>
decodeOnlyPresentationTimestamps
;
private
final
MediaCodec
.
BufferInfo
outputBufferInfo
;
private
final
MediaCodec
.
BufferInfo
outputBufferInfo
;
private
boolean
drmResourcesAcquired
;
@Nullable
private
Format
inputFormat
;
@Nullable
private
Format
inputFormat
;
private
Format
outputFormat
;
private
Format
outputFormat
;
@Nullable
private
DrmSession
<
FrameworkMediaCrypto
>
codecDrmSession
;
@Nullable
private
DrmSession
<
FrameworkMediaCrypto
>
codecDrmSession
;
...
@@ -597,6 +598,10 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
...
@@ -597,6 +598,10 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
@Override
@Override
protected
void
onEnabled
(
boolean
joining
)
throws
ExoPlaybackException
{
protected
void
onEnabled
(
boolean
joining
)
throws
ExoPlaybackException
{
if
(
drmSessionManager
!=
null
&&
!
drmResourcesAcquired
)
{
drmResourcesAcquired
=
true
;
drmSessionManager
.
prepare
();
}
decoderCounters
=
new
DecoderCounters
();
decoderCounters
=
new
DecoderCounters
();
}
}
...
@@ -637,6 +642,10 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
...
@@ -637,6 +642,10 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
}
finally
{
}
finally
{
setSourceDrmSession
(
null
);
setSourceDrmSession
(
null
);
}
}
if
(
drmSessionManager
!=
null
&&
drmResourcesAcquired
)
{
drmResourcesAcquired
=
false
;
drmSessionManager
.
release
();
}
}
}
protected
void
releaseCodec
()
{
protected
void
releaseCodec
()
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/video/SimpleDecoderVideoRenderer.java
View file @
19c88583
...
@@ -77,6 +77,7 @@ public abstract class SimpleDecoderVideoRenderer extends BaseRenderer {
...
@@ -77,6 +77,7 @@ public abstract class SimpleDecoderVideoRenderer extends BaseRenderer {
private
final
DecoderInputBuffer
flagsOnlyBuffer
;
private
final
DecoderInputBuffer
flagsOnlyBuffer
;
private
final
DrmSessionManager
<
ExoMediaCrypto
>
drmSessionManager
;
private
final
DrmSessionManager
<
ExoMediaCrypto
>
drmSessionManager
;
private
boolean
drmResourcesAcquired
;
private
Format
inputFormat
;
private
Format
inputFormat
;
private
Format
outputFormat
;
private
Format
outputFormat
;
private
SimpleDecoder
<
private
SimpleDecoder
<
...
@@ -237,6 +238,10 @@ public abstract class SimpleDecoderVideoRenderer extends BaseRenderer {
...
@@ -237,6 +238,10 @@ public abstract class SimpleDecoderVideoRenderer extends BaseRenderer {
@Override
@Override
protected
void
onEnabled
(
boolean
joining
)
throws
ExoPlaybackException
{
protected
void
onEnabled
(
boolean
joining
)
throws
ExoPlaybackException
{
if
(
drmSessionManager
!=
null
&&
!
drmResourcesAcquired
)
{
drmResourcesAcquired
=
true
;
drmSessionManager
.
prepare
();
}
decoderCounters
=
new
DecoderCounters
();
decoderCounters
=
new
DecoderCounters
();
eventDispatcher
.
enabled
(
decoderCounters
);
eventDispatcher
.
enabled
(
decoderCounters
);
}
}
...
@@ -287,6 +292,14 @@ public abstract class SimpleDecoderVideoRenderer extends BaseRenderer {
...
@@ -287,6 +292,14 @@ public abstract class SimpleDecoderVideoRenderer extends BaseRenderer {
}
}
@Override
@Override
protected
void
onReset
()
{
if
(
drmSessionManager
!=
null
&&
drmResourcesAcquired
)
{
drmResourcesAcquired
=
false
;
drmSessionManager
.
release
();
}
}
@Override
protected
void
onStreamChanged
(
Format
[]
formats
,
long
offsetUs
)
throws
ExoPlaybackException
{
protected
void
onStreamChanged
(
Format
[]
formats
,
long
offsetUs
)
throws
ExoPlaybackException
{
outputStreamOffsetUs
=
offsetUs
;
outputStreamOffsetUs
=
offsetUs
;
super
.
onStreamChanged
(
formats
,
offsetUs
);
super
.
onStreamChanged
(
formats
,
offsetUs
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment