-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mp4,matroska: Add *_path/0 variant that uses format_root
- Loading branch information
Showing
4 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
# <matroska value> | matroska_path(".Segment.Tracks[0].TrackEntry[1].CodecID") -> element | ||
# <matroska value> | matroska_path(<matroska value>) -> ".Segment.Tracks[0]" | ||
def matroska_path(p): tree_path(.elements; .id; p); | ||
# <matroska root value> | matroska_path(".Segment.Tracks[0]") -> element | ||
# <matroska root value> | matroska_path -> ".Segment.Tracks[0]" | ||
# <matroska root value> | matroska_path(<matroska root value>) -> ".Segment.Tracks[0]" | ||
def matroska_path(p): | ||
_decode_value( | ||
( if format != "matroska" then error("not matroska format") end | ||
| tree_path(.elements; .id; p) | ||
) | ||
); | ||
def matroska_path: | ||
( . as $c | ||
| format_root | ||
| matroska_path($c) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
# <mp4 value> | mp4_path(".moov.trak[1]") -> box | ||
# <mp4 value> | mp4_path(<mp4 value>) -> ".moov.trak" | ||
def mp4_path(p): tree_path(.boxes; .type; p); | ||
# <mp4 root> | mp4_path(".moov.trak[1]") -> box | ||
# box -> | mp4_path -> ".moov.trak[1]" | ||
# box -> | mp4_path(<mp4 root>) -> ".moov.trak[1]" | ||
def mp4_path(p): | ||
_decode_value( | ||
( if format != "mp4" then error("not mp4 format") end | ||
| tree_path(.boxes; .type; p) | ||
) | ||
); | ||
def mp4_path: | ||
( . as $c | ||
| format_root | ||
| mp4_path($c) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters