Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ffmpeg/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Versions
VPX_VERSION=1.13.0
MBEDTLS_VERSION=3.4.1
FFMPEG_VERSION=6.0
FFMPEG_VERSION=8.1

# Directories
BASE_DIR=$(cd "$(dirname "$0")" && pwd)
Expand Down Expand Up @@ -211,7 +211,7 @@ function buildFfmpeg() {
;;
x86_64)
TOOLCHAIN=x86_64-linux-android21-
CPU=x86_64
CPU=x86-64
ARCH=x86_64
;;
*)
Expand Down Expand Up @@ -247,7 +247,6 @@ function buildFfmpeg() {
--disable-vulkan \
--disable-avdevice \
--disable-avformat \
--disable-postproc \
--disable-avfilter \
--disable-symver \
--enable-parsers \
Expand Down
11 changes: 8 additions & 3 deletions mediainfo/src/main/cpp/media_thumbnail_retriever.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ static int read_rotation_degrees(AVStream *stream) {
rotation = normalize_rotation(atoi(rotateTag->value));
}

uint8_t *displayMatrix = av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr);
if (displayMatrix) {
double theta = av_display_rotation_get(reinterpret_cast<int32_t *>(displayMatrix));
const AVPacketSideData *sideData = av_packet_side_data_get(
stream->codecpar->coded_side_data,
stream->codecpar->nb_coded_side_data,
AV_PKT_DATA_DISPLAYMATRIX
);

if (sideData) {
double theta = av_display_rotation_get((const int32_t *)(sideData->data));
rotation = normalize_rotation(static_cast<int>(-theta));
}

Expand Down
19 changes: 14 additions & 5 deletions mediainfo/src/main/cpp/mediainfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ void onVideoStreamFound(JNIEnv *env, jobject jMediaInfoBuilder, AVFormatContext
rotation %= 360;
if (rotation < 0) rotation += 360;
}
uint8_t *displaymatrix = av_stream_get_side_data(stream,
AV_PKT_DATA_DISPLAYMATRIX,
nullptr);
if (displaymatrix) {
double theta = av_display_rotation_get((int32_t *) displaymatrix);

const AVPacketSideData *sideData = av_packet_side_data_get(
stream->codecpar->coded_side_data,
stream->codecpar->nb_coded_side_data,
AV_PKT_DATA_DISPLAYMATRIX
);

if (sideData) {
double theta = av_display_rotation_get((const int32_t *) sideData->data);
rotation = (int) (-theta) % 360;
if (rotation < 0) rotation += 360;
}
Expand Down Expand Up @@ -223,6 +227,11 @@ void media_info_build(JNIEnv *env, jobject jMediaInfoBuilder, const char *uri) {
case AVMEDIA_TYPE_SUBTITLE:
onSubtitleStreamFound(env, jMediaInfoBuilder, avFormatContext, pos);
break;
case AVMEDIA_TYPE_UNKNOWN:
case AVMEDIA_TYPE_DATA:
case AVMEDIA_TYPE_ATTACHMENT:
case AVMEDIA_TYPE_NB:
break;
}
}

Expand Down
Loading