-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement skeleton of native litr-muxers module #239
Conversation
@@ -49,9 +50,11 @@ class SharedMediaStoragePublisher @JvmOverloads constructor( | |||
if (!file.exists()) return null | |||
|
|||
val newFileName = file.name | |||
val extension = MimeTypeMap.getFileExtensionFromUrl(newFileName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this issue when I tested muxing to mkv
. It probably happens today if you mux to webm. This small change just means that we build a demo app filepath that has the correct extension. It only impacts the demo app.
# If locally built ffmpeg binaries are available, we will prioritise these. This is preferable as | ||
# ensures they are built to match exactly what the consumer requires. However, we will allow the | ||
# build to fallback to those bundled with the repository. | ||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@izzytwosheds - After our chat yesterday, I added this condition. If we detect locally built binaries, we will use them. However, I have included versions that i've built myself that it will fall back too. If you're happy with this, you may want to replace those bundled binaries with versions you've built yourself.
PRIVATE avformat | ||
PRIVATE ${log-lib}) | ||
|
||
set_property(TARGET litr-muxers PROPERTY LINKER_LANGUAGE CXX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added because after removing all the CPP files, cmake didn't know how to link :D
#ifndef LITR_FFMPEG_H | ||
#define LITR_FFMPEG_H | ||
|
||
extern "C" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the code in this module will be C++, and libavformat (and deps) are C, I created this header to make it easy to import/include.
#include <android/log.h> | ||
|
||
#define LOG_TAG "LiTrMuxers_JNI" | ||
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging functions that can be used from C++ that will end up in Android's logcat.
ENABLED_DECODERS=("${@:4}") | ||
JOBS=$(nproc 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null || echo 4) | ||
echo "Using $JOBS jobs for make" | ||
COMMON_OPTIONS=" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script is based upon ExoPlayer's ffmpeg module, except with everything disabled. I've only enabled what is required to match the capabilities of Android's MediaMuxer, with the addition of segmented support.
Part of #235
This first PR does the following:
litr-muxers
to contain the native muxers module (based upon libavformat)