Skip to content

Commit

Permalink
feat(las): register ijklas demuxer & find through it's format_name
Browse files Browse the repository at this point in the history
feat(las): find ijklas demuxer through it's format name
  • Loading branch information
johnwenjunwu committed Apr 23, 2021
1 parent a6e5146 commit 13f03e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public void setHudView(TableLayout tableLayout) {
public void setVideoPath(String path) {
if (path.contains("adaptationSet")){
mManifestString = path;
setVideoURI(Uri.EMPTY);
setVideoURI(Uri.parse("manifest.las"));
} else {
setVideoURI(Uri.parse(path));
}
Expand Down Expand Up @@ -1044,6 +1044,7 @@ public IMediaPlayer createPlayer(int playerType) {
ijkMediaPlayer.native_setLogLevel(IjkMediaPlayer.IJK_LOG_DEBUG);

if (mManifestString != null) {
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "iformat", "ijklas");
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "is-manifest", 1);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "manifest_string", mManifestString);
}
Expand Down
1 change: 1 addition & 0 deletions ijkmedia/ijkplayer/ijkavformat/allformats.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@ void ijkav_register_all(void)
IJK_REGISTER_PROTOCOL(ijksegment);
/* demuxers */
IJK_REGISTER_DEMUXER(ijklivehook);
IJK_REGISTER_DEMUXER(ijklas);
av_log(NULL, AV_LOG_INFO, "===== custom modules end =====\n");
}
12 changes: 6 additions & 6 deletions ijkmedia/ijkplayer/ijkavformat/ijklas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ static int las_close(AVFormatContext* s) {
}

static int las_probe(AVProbeData* p) {
if (p->filename && strstr(p->filename, ".las"))
if (p->filename && strstr(p->filename, "manifest.las"))
return AVPROBE_SCORE_MAX;

return 0;
Expand Down Expand Up @@ -2108,17 +2108,17 @@ static const AVOption las_options[] = {
{NULL}
};

static const AVClass las_class = {
.class_name = "las",
static const AVClass ijklas_class = {
.class_name = "las demuxer",
.item_name = av_default_item_name,
.option = las_options,
.version = LIBAVUTIL_VERSION_INT,
};

AVInputFormat ijkff_las_demuxer = {
.name = "las",
AVInputFormat ijkff_ijklas_demuxer = {
.name = "ijklas",
.long_name = "Live Adaptive Streaming",
.priv_class = &las_class,
.priv_class = &ijklas_class,
.priv_data_size = sizeof(LasContext),
.read_probe = las_probe,
.read_header = las_read_header,
Expand Down

0 comments on commit 13f03e8

Please sign in to comment.