File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
- import hachoir .metadata
3
2
import hachoir .parser
4
3
5
-
6
4
from hachoir .field import MissingField
7
5
from hachoir .field .string_field import String
8
6
@@ -16,6 +14,17 @@ def get_raw_content(met):
16
14
return stream .read (met .absolute_address , met .size )
17
15
18
16
17
+ def get_gpmf_payloads_from_file (filepath ):
18
+ """Get payloads from file, returns a tuple with the payloads iterator and the parser instance"""
19
+ parser = hachoir .parser .createParser (filepath )
20
+ return (get_payloads (find_gpmd_stbl_atom (parser )), parser )
21
+
22
+
23
+ def get_gpmf_payloads (parser ):
24
+ """Shorthand for finding the GPMF atom to be passed to get_payloads"""
25
+ return get_payloads (find_gpmd_stbl_atom (parser ))
26
+
27
+
19
28
def get_payloads (stbl ):
20
29
"""Get payloads by chunk from stbl, with timing info"""
21
30
# Locate needed subatoms
You can’t perform that action at this time.
0 commit comments