mirror of https://github.com/mpv-player/mpv
demux_mkv: support ProjectionPoseRoll element
This commit is contained in:
parent
338f31e0b6
commit
a4bf0bd695
|
@ -110,6 +110,8 @@ typedef struct mkv_track {
|
||||||
struct mp_colorspace color;
|
struct mp_colorspace color;
|
||||||
uint32_t v_crop_top, v_crop_left, v_crop_right, v_crop_bottom;
|
uint32_t v_crop_top, v_crop_left, v_crop_right, v_crop_bottom;
|
||||||
bool v_crop_top_set, v_crop_left_set, v_crop_right_set, v_crop_bottom_set;
|
bool v_crop_top_set, v_crop_left_set, v_crop_right_set, v_crop_bottom_set;
|
||||||
|
float v_projection_pose_roll;
|
||||||
|
bool v_projection_pose_roll_set;
|
||||||
|
|
||||||
uint32_t a_channels, a_bps;
|
uint32_t a_channels, a_bps;
|
||||||
float a_sfreq;
|
float a_sfreq;
|
||||||
|
@ -606,6 +608,20 @@ static void parse_trackcolour(struct demuxer *demuxer, struct mkv_track *track,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void parse_trackprojection(struct demuxer *demuxer, struct mkv_track *track,
|
||||||
|
struct ebml_projection *projection)
|
||||||
|
{
|
||||||
|
if (projection->n_projection_pose_yaw || projection->n_projection_pose_pitch)
|
||||||
|
MP_WARN(demuxer, "Projection pose yaw/pitch not supported!\n");
|
||||||
|
|
||||||
|
if (projection->n_projection_pose_roll) {
|
||||||
|
track->v_projection_pose_roll = projection->projection_pose_roll;
|
||||||
|
track->v_projection_pose_roll_set = true;
|
||||||
|
MP_DBG(demuxer, "| + Projection pose roll: %f\n",
|
||||||
|
track->v_projection_pose_roll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void parse_trackvideo(struct demuxer *demuxer, struct mkv_track *track,
|
static void parse_trackvideo(struct demuxer *demuxer, struct mkv_track *track,
|
||||||
struct ebml_video *video)
|
struct ebml_video *video)
|
||||||
{
|
{
|
||||||
|
@ -667,6 +683,8 @@ static void parse_trackvideo(struct demuxer *demuxer, struct mkv_track *track,
|
||||||
}
|
}
|
||||||
if (video->n_colour)
|
if (video->n_colour)
|
||||||
parse_trackcolour(demuxer, track, &video->colour);
|
parse_trackcolour(demuxer, track, &video->colour);
|
||||||
|
if (video->n_projection)
|
||||||
|
parse_trackprojection(demuxer, track, &video->projection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1509,6 +1527,11 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track)
|
||||||
sh_v->crop.y1 = track->v_height -
|
sh_v->crop.y1 = track->v_height -
|
||||||
(track->v_crop_bottom_set ? track->v_crop_bottom : 0);
|
(track->v_crop_bottom_set ? track->v_crop_bottom : 0);
|
||||||
|
|
||||||
|
if (track->v_projection_pose_roll_set) {
|
||||||
|
int rotate = lrintf(fmodf(fmodf(track->v_projection_pose_roll, 360) + 360, 360));
|
||||||
|
sh_v->rotate = rotate;
|
||||||
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
demux_add_sh_stream(demuxer, sh);
|
demux_add_sh_stream(demuxer, sh);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue