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
b70fdf1b
authored
Jan 25, 2021
by
Ian Baker
Committed by
bachinger
Apr 30, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove FfmpegVideoRenderer from 2.14.0 release
parent
7e8abc43
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
180 deletions
extensions/ffmpeg/src/main/java/com/google/android/exoplayer2/ext/ffmpeg/FfmpegLibrary.java
extensions/ffmpeg/src/main/java/com/google/android/exoplayer2/ext/ffmpeg/FfmpegVideoRenderer.java
extensions/ffmpeg/src/test/java/com/google/android/exoplayer2/ext/ffmpeg/DefaultRenderersFactoryTest.java
library/core/proguard-rules.txt
library/core/src/main/java/com/google/android/exoplayer2/DefaultRenderersFactory.java
extensions/ffmpeg/src/main/java/com/google/android/exoplayer2/ext/ffmpeg/FfmpegLibrary.java
View file @
b70fdf1b
...
@@ -42,7 +42,7 @@ public final class FfmpegLibrary {
...
@@ -42,7 +42,7 @@ public final class FfmpegLibrary {
/**
/**
* Override the names of the FFmpeg native libraries. If an application wishes to call this
* Override the names of the FFmpeg native libraries. If an application wishes to call this
* method, it must do so before calling any other method defined by this class, and before
* method, it must do so before calling any other method defined by this class, and before
* instantiating a {@link FfmpegAudioRenderer}
or {@link FfmpegVideoRenderer}
instance.
* instantiating a {@link FfmpegAudioRenderer} instance.
*
*
* @param libraries The names of the FFmpeg native libraries.
* @param libraries The names of the FFmpeg native libraries.
*/
*/
...
@@ -142,10 +142,6 @@ public final class FfmpegLibrary {
...
@@ -142,10 +142,6 @@ public final class FfmpegLibrary {
return
"pcm_mulaw"
;
return
"pcm_mulaw"
;
case
MimeTypes
.
AUDIO_ALAW
:
case
MimeTypes
.
AUDIO_ALAW
:
return
"pcm_alaw"
;
return
"pcm_alaw"
;
case
MimeTypes
.
VIDEO_H264
:
return
"h264"
;
case
MimeTypes
.
VIDEO_H265
:
return
"hevc"
;
default
:
default
:
return
null
;
return
null
;
}
}
...
...
extensions/ffmpeg/src/main/java/com/google/android/exoplayer2/ext/ffmpeg/FfmpegVideoRenderer.java
deleted
100644 → 0
View file @
7e8abc43
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
ext
.
ffmpeg
;
import
static
com
.
google
.
android
.
exoplayer2
.
decoder
.
DecoderReuseEvaluation
.
DISCARD_REASON_MIME_TYPE_CHANGED
;
import
static
com
.
google
.
android
.
exoplayer2
.
decoder
.
DecoderReuseEvaluation
.
REUSE_RESULT_NO
;
import
static
com
.
google
.
android
.
exoplayer2
.
decoder
.
DecoderReuseEvaluation
.
REUSE_RESULT_YES_WITHOUT_RECONFIGURATION
;
import
android.os.Handler
;
import
android.view.Surface
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.RendererCapabilities
;
import
com.google.android.exoplayer2.decoder.Decoder
;
import
com.google.android.exoplayer2.decoder.DecoderReuseEvaluation
;
import
com.google.android.exoplayer2.drm.ExoMediaCrypto
;
import
com.google.android.exoplayer2.util.TraceUtil
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.video.DecoderVideoRenderer
;
import
com.google.android.exoplayer2.video.VideoDecoderInputBuffer
;
import
com.google.android.exoplayer2.video.VideoDecoderOutputBuffer
;
import
com.google.android.exoplayer2.video.VideoRendererEventListener
;
// TODO: Remove the NOTE below.
/**
* <b>NOTE: This class if under development and is not yet functional.</b>
*
* <p>Decodes and renders video using FFmpeg.
*/
public
final
class
FfmpegVideoRenderer
extends
DecoderVideoRenderer
{
private
static
final
String
TAG
=
"FfmpegVideoRenderer"
;
/**
* Creates a new instance.
*
* @param allowedJoiningTimeMs The maximum duration in milliseconds for which this video renderer
* can attempt to seamlessly join an ongoing playback.
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required.
* @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
* invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
*/
public
FfmpegVideoRenderer
(
long
allowedJoiningTimeMs
,
@Nullable
Handler
eventHandler
,
@Nullable
VideoRendererEventListener
eventListener
,
int
maxDroppedFramesToNotify
)
{
super
(
allowedJoiningTimeMs
,
eventHandler
,
eventListener
,
maxDroppedFramesToNotify
);
// TODO: Implement.
}
@Override
public
String
getName
()
{
return
TAG
;
}
@Override
@RendererCapabilities
.
Capabilities
public
final
int
supportsFormat
(
Format
format
)
{
// TODO: Remove this line and uncomment the implementation below.
return
C
.
FORMAT_UNSUPPORTED_TYPE
;
/*
String mimeType = Assertions.checkNotNull(format.sampleMimeType);
if (!FfmpegLibrary.isAvailable() || !MimeTypes.isVideo(mimeType)) {
return FORMAT_UNSUPPORTED_TYPE;
} else if (!FfmpegLibrary.supportsFormat(format.sampleMimeType)) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_SUBTYPE);
} else if (format.exoMediaCryptoType != null) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_DRM);
} else {
return RendererCapabilities.create(
FORMAT_HANDLED,
ADAPTIVE_SEAMLESS,
TUNNELING_NOT_SUPPORTED);
}
*/
}
@SuppressWarnings
(
"return.type.incompatible"
)
@Override
protected
Decoder
<
VideoDecoderInputBuffer
,
VideoDecoderOutputBuffer
,
FfmpegDecoderException
>
createDecoder
(
Format
format
,
@Nullable
ExoMediaCrypto
mediaCrypto
)
throws
FfmpegDecoderException
{
TraceUtil
.
beginSection
(
"createFfmpegVideoDecoder"
);
// TODO: Implement, remove the SuppressWarnings annotation, and update the return type to use
// the concrete type of the decoder (probably FfmepgVideoDecoder).
TraceUtil
.
endSection
();
return
null
;
}
@Override
protected
void
renderOutputBufferToSurface
(
VideoDecoderOutputBuffer
outputBuffer
,
Surface
surface
)
throws
FfmpegDecoderException
{
// TODO: Implement.
}
@Override
protected
void
setDecoderOutputMode
(
@C
.
VideoOutputMode
int
outputMode
)
{
// TODO: Uncomment the implementation below.
/*
if (decoder != null) {
decoder.setOutputMode(outputMode);
}
*/
}
@Override
protected
DecoderReuseEvaluation
canReuseDecoder
(
String
decoderName
,
Format
oldFormat
,
Format
newFormat
)
{
boolean
sameMimeType
=
Util
.
areEqual
(
oldFormat
.
sampleMimeType
,
newFormat
.
sampleMimeType
);
// TODO: Ability to reuse the decoder may be MIME type dependent.
return
new
DecoderReuseEvaluation
(
decoderName
,
oldFormat
,
newFormat
,
sameMimeType
?
REUSE_RESULT_YES_WITHOUT_RECONFIGURATION
:
REUSE_RESULT_NO
,
sameMimeType
?
0
:
DISCARD_REASON_MIME_TYPE_CHANGED
);
}
}
extensions/ffmpeg/src/test/java/com/google/android/exoplayer2/ext/ffmpeg/DefaultRenderersFactoryTest.java
View file @
b70fdf1b
...
@@ -22,8 +22,7 @@ import org.junit.Test;
...
@@ -22,8 +22,7 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
/**
/**
* Unit test for {@link DefaultRenderersFactoryTest} with {@link FfmpegAudioRenderer} and {@link
* Unit test for {@link DefaultRenderersFactoryTest} with {@link FfmpegAudioRenderer}.
* FfmpegVideoRenderer}.
*/
*/
@RunWith
(
AndroidJUnit4
.
class
)
@RunWith
(
AndroidJUnit4
.
class
)
public
final
class
DefaultRenderersFactoryTest
{
public
final
class
DefaultRenderersFactoryTest
{
...
@@ -33,10 +32,4 @@ public final class DefaultRenderersFactoryTest {
...
@@ -33,10 +32,4 @@ public final class DefaultRenderersFactoryTest {
DefaultRenderersFactoryAsserts
.
assertExtensionRendererCreated
(
DefaultRenderersFactoryAsserts
.
assertExtensionRendererCreated
(
FfmpegAudioRenderer
.
class
,
C
.
TRACK_TYPE_AUDIO
);
FfmpegAudioRenderer
.
class
,
C
.
TRACK_TYPE_AUDIO
);
}
}
@Test
public
void
createRenderers_instantiatesFfmpegVideoRenderer
()
{
DefaultRenderersFactoryAsserts
.
assertExtensionRendererCreated
(
FfmpegVideoRenderer
.
class
,
C
.
TRACK_TYPE_VIDEO
);
}
}
}
library/core/proguard-rules.txt
View file @
b70fdf1b
...
@@ -14,10 +14,6 @@
...
@@ -14,10 +14,6 @@
-keepclassmembers class com.google.android.exoplayer2.ext.av1.Libgav1VideoRenderer {
-keepclassmembers class com.google.android.exoplayer2.ext.av1.Libgav1VideoRenderer {
<init>(long, android.os.Handler, com.google.android.exoplayer2.video.VideoRendererEventListener, int);
<init>(long, android.os.Handler, com.google.android.exoplayer2.video.VideoRendererEventListener, int);
}
}
-dontnote com.google.android.exoplayer2.ext.ffmpeg.FfmpegVideoRenderer
-keepclassmembers class com.google.android.exoplayer2.ext.ffmpeg.FfmpegVideoRenderer {
<init>(long, android.os.Handler, com.google.android.exoplayer2.video.VideoRendererEventListener, int);
}
-dontnote com.google.android.exoplayer2.ext.opus.LibopusAudioRenderer
-dontnote com.google.android.exoplayer2.ext.opus.LibopusAudioRenderer
-keepclassmembers class com.google.android.exoplayer2.ext.opus.LibopusAudioRenderer {
-keepclassmembers class com.google.android.exoplayer2.ext.opus.LibopusAudioRenderer {
<init>(android.os.Handler, com.google.android.exoplayer2.audio.AudioRendererEventListener, com.google.android.exoplayer2.audio.AudioSink);
<init>(android.os.Handler, com.google.android.exoplayer2.audio.AudioRendererEventListener, com.google.android.exoplayer2.audio.AudioSink);
...
...
library/core/src/main/java/com/google/android/exoplayer2/DefaultRenderersFactory.java
View file @
b70fdf1b
...
@@ -441,34 +441,6 @@ public class DefaultRenderersFactory implements RenderersFactory {
...
@@ -441,34 +441,6 @@ public class DefaultRenderersFactory implements RenderersFactory {
// The extension is present, but instantiation failed.
// The extension is present, but instantiation failed.
throw
new
RuntimeException
(
"Error instantiating AV1 extension"
,
e
);
throw
new
RuntimeException
(
"Error instantiating AV1 extension"
,
e
);
}
}
try
{
// Full class names used for constructor args so the LINT rule triggers if any of them move.
// LINT.IfChange
Class
<?>
clazz
=
Class
.
forName
(
"com.google.android.exoplayer2.ext.ffmpeg.FfmpegVideoRenderer"
);
Constructor
<?>
constructor
=
clazz
.
getConstructor
(
long
.
class
,
android
.
os
.
Handler
.
class
,
com
.
google
.
android
.
exoplayer2
.
video
.
VideoRendererEventListener
.
class
,
int
.
class
);
// LINT.ThenChange(../../../../../../../proguard-rules.txt)
Renderer
renderer
=
(
Renderer
)
constructor
.
newInstance
(
allowedVideoJoiningTimeMs
,
eventHandler
,
eventListener
,
MAX_DROPPED_VIDEO_FRAME_COUNT_TO_NOTIFY
);
out
.
add
(
extensionRendererIndex
++,
renderer
);
Log
.
i
(
TAG
,
"Loaded FfmpegVideoRenderer."
);
}
catch
(
ClassNotFoundException
e
)
{
// Expected if the app was built without the extension.
}
catch
(
Exception
e
)
{
// The extension is present, but instantiation failed.
throw
new
RuntimeException
(
"Error instantiating FFmpeg extension"
,
e
);
}
}
}
/**
/**
...
...
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