aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/file-mp4.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-19MP4: add support for segment boxes (styp, sidx)Sergey V. Lobanov1-0/+150
sidx and styp boxes are implemented according to 3GPP TS 26.244 Both boxes are added as mp4 magic bytes due to mp4 segments start from them pcap and mp4 samples: https://wiki.wireshark.org/SampleCaptures#mp4-init-segments-and-segments
2022-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-4/+4
Do not require a useless ENC_NA parameter for string encodings. FT_STRING and FT_STRINGZ types don't have any ndianness. Follow-up to 6ec429622c9258eefd388caf21ce92ab5b9f54b4.
2021-12-19Fix errors found by fix-encoding-args.plJoão Valverde1-1/+1
2021-12-19Replace g_snprintf() with snprintf() (dissectors)João Valverde1-4/+4
Use macros from inttypes.h with format strings.
2021-07-22mp4: handle missing timescaleEvan Huus1-12/+20
Avoid various divide-by-zeros when there are durations with no timescale set. Also fix a rare potential memory leak while I'm here.
2021-07-21First pass pinfo->pool conversionEvan Huus1-1/+1
Automated find/replace of wmem_packet_scope() with pinfo->pool in all files where it didn't cause a build failure. I also tweaked a few of the docs which got caught up.
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-3/+3
The static arrays are supposed to be arrays of const pointers to int, not arrays of non-const pointers to const int. Fixing that means some bugs (scribbling on what's *supposed* to be a const array) will be caught (see packet-ieee80211-radiotap.c for examples, the first of which inspired this change and the second of which was discovered while testing compiles with this change), and removes the need for some annoying casts. Also make some of those arrays static while we're at it. Update documentation and dissector-generator tools. Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc Reviewed-on: https://code.wireshark.org/review/37517 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-05mp4: remove _U_ for a parameter which is usedMartin Kaiser1-1/+1
This fixes a -Wused-but-marked-unused compiler warning. Change-Id: I6a4b5a98237bdb1573bb893eeea2b510d7780f06 Reviewed-on: https://code.wireshark.org/review/36701 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-18mp4(file): Fix Dead StoreAlexis La Goutte1-2/+1
Fix dead store (Dead assignement/Dead increment) Warning found by Clang Change-Id: I4f07d18cef039d671ca3bbade8ca956be1341b56 Reviewed-on: https://code.wireshark.org/review/36082 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-27mp4: dissect Chunk Offset Box (stco)Jakub Adam1-0/+39
Change-Id: I138ff276e7b095f42325bc10e730f624b4bbd1ef Reviewed-on: https://code.wireshark.org/review/35939 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-27mp4: dissect Sample To Chunk Box (stsc)Jakub Adam1-1/+64
Change-Id: I14c349f1a9811355f6f41c4518bc6161d2d6cca0 Reviewed-on: https://code.wireshark.org/review/35938 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-27mp4: improve Sample Size Box (stsz) dissectionJakub Adam1-5/+10
* Describe what sample size == 0 means. * Show an index next to each table entry. * Table indices start from 1 according to the specification. Change-Id: I106188051e6618c3b85fa4945facfe4fedd1987b Reviewed-on: https://code.wireshark.org/review/35937 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-27mp4: dissect Edit List Box (elst)Jakub Adam1-11/+119
Change-Id: I350a87cfccdff4bf117d6f84c575ed5282ee573a Reviewed-on: https://code.wireshark.org/review/35936 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-27mp4: improve Movie Header Box (mvhd) dissectionJakub Adam1-4/+17
Display movie duration in seconds. The number of duration units in one second is determined by timescale parameter. Change-Id: Ie61e4365f7f751a6d23eff0b3bc9b170b499e60a Reviewed-on: https://code.wireshark.org/review/35935 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-27mp4: fix Sample Size Box (stsz) dissectionJakub Adam1-0/+3
'stsz' extends FullBox, so it has 'version' and 'flags' fields. Change-Id: Ibaf99e80ef0ff17104a81da73c08a06acc011173 Reviewed-on: https://code.wireshark.org/review/35932 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-27mp4: dissect edts boxJakub Adam1-0/+3
Change-Id: I01ceaac38a9c59c2546a96fff419510f2289c62f Reviewed-on: https://code.wireshark.org/review/35931 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-27mp4: dissect ctts boxJakub Adam1-1/+61
Change-Id: I4a8c5d0eb29feef2577535e2dd7c0a14408bfb84 Reviewed-on: https://code.wireshark.org/review/35930 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-27mp4: dissect stts boxJakub Adam1-2/+56
Change-Id: If6ad1aadf8ef5901490047f07513578ad3d5d1a9 Reviewed-on: https://code.wireshark.org/review/35889 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-26mp4: factor out FullBox dissectionJakub Adam1-56/+44
Avoid repeating code dealing with dissection of version and flags fields that ISO/IEC 14496-12 defines in FullBox class. Change-Id: I72cb4072c8bb41a670d41187692dd72697dd1049 Reviewed-on: https://code.wireshark.org/review/35888 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-26mp4: tkhd times are encoded as ENC_TIME_CLASSIC_MAC_OS_SECSJakub Adam1-2/+2
Change-Id: I4be6639c469e01a2f6b1bbe9d4a8bc65ea44f836 Reviewed-on: https://code.wireshark.org/review/35905 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-21Add support for "classic Mac OS" timestamps and use them in file-mp4.c.Guy Harris1-24/+14
Those times are in seconds since January 1, 1904, 00:00:00 (proleptic?) UTC. MPEG-4 Part 14 (MP4) is based on QuickTime, so it uses classic Mac OS time stamps, in seconds. Change-Id: Ibcd7faf1b119d8acbb294c95b66ca0d1fb70cbb3 Reviewed-on: https://code.wireshark.org/review/35886 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-01-21mp4: Fix uint64 printf formatStig Bjørlykke1-1/+1
Use G_GUINT64_FORMAT for uint64. Change-Id: I2c839f1637d088d905c22e615bdf35fe967827d6 Reviewed-on: https://code.wireshark.org/review/35885 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2020-01-21mp4: dissect Track Header Box (tkhd) flagsJakub Adam1-3/+33
Change-Id: Id1f035ccc571fe29effb8344b05f4b2b564374bb Reviewed-on: https://code.wireshark.org/review/35876 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-21mp4: display timestamps in human-readable formatJakub Adam1-4/+18
Change-Id: Ic8ef5d835b8263b747c856e7a3c66701547d07e7 Reviewed-on: https://code.wireshark.org/review/35875 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-14wiretap: Add MP4 readerJakub Adam1-0/+1
Allows opening MP4 (ISO/IEC 14496-12) media files in Wireshark and viewing their structure. Change-Id: Ie20b8b89dc69bb52d6faa890e547d90317adecf6 Reviewed-on: https://code.wireshark.org/review/35804 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-28mp4: limit the recursion depth for boxesMartin Kaiser1-25/+44
Although the dissection of each box header consumes a couple of bytes, it turned out that it's still possible to crash wireshark with a sample file that contains a large number of nested boxes. The stack will fill up before we reach the end of the data bytes. Keep track of the recursion depth as we walk through the hierarchy of boxes. Abort if we reach the (locally defined) upper limit. Bug: 13777 Change-Id: I0f67245a5c74131f10d0f9d99b39ad31711b9775 Reviewed-on: https://code.wireshark.org/review/26167 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-13Adjust proto_tree_add_[float|double]_format_value calls to use unit stringMichael Mann1-8/+4
Several calls to proto_tree_add_[float|double]_xxx could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Id0da7b579403898d20c2667d6c4abcd59d5a48d4 Reviewed-on: https://code.wireshark.org/review/19241 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-28Fix some warnings/errors of typeJoerg Mayer1-1/+1
git/epan/dissectors/packet-a21.c:478:25: error: 'item' was marked unused but was used [-Werror,-Wused-but-marked-unused] proto_item_append_text(item, "%s", val_to_str_const(event_id, a21_event_vals, "Unknown")); ^ Added manual change id because file-jpeg.c forced the use of commit -n Change-Id: Iffff53d6253758c8454d9583f0a11f317c8390cb Reviewed-on: https://code.wireshark.org/review/14666 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-1/+1
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now. Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f Reviewed-on: https://code.wireshark.org/review/12484 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-05Associate the file-mp4 dissector with the audio/mp4 MIME typeTyson Key1-0/+1
Bug:11338 Change-Id: Ied463ea5ef65bcc657e09c0d5f7983cb4dcd581a Reviewed-on: https://code.wireshark.org/review/9503 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-22Include <math.h> or <stdlib.h> as necessary to declare functions.Guy Harris1-0/+1
Various floating-point math functions require <math.h>, and abs() requires <stdlib.h>. Change-Id: I6831cfdb17eac3ce129b6800f0fe82fbcfef2d28 Reviewed-on: https://code.wireshark.org/review/6002 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-22First batch of unincludes. Last attempt...Martin Mathieson1-1/+0
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9 Reviewed-on: https://code.wireshark.org/review/5997 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+2
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-15MP4: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang ↵Alexis La Goutte1-1/+1
> 3.3 Change-Id: I0befc8846b9af43e1563adb369ba4d332775ef76 Reviewed-on: https://code.wireshark.org/review/5778 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-15MP4: fix Unused entry: epan/dissectors/file-mp4.c, hf_mp4_stsd_entry_cntAlexis La Goutte1-1/+1
Change-Id: I95f0ab387570c0c56e19990cb9b9063051bb792f Reviewed-on: https://code.wireshark.org/review/5779 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-03start dissecting the stsz boxMartin Kaiser1-0/+48
Change-Id: Ia8fce9307bae33c44d630af403980d162afd88c2 Reviewed-on: https://code.wireshark.org/review/5597 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-03BOX_TYPE_STZ2Martin Kaiser1-0/+2
Change-Id: I4eadf2b613b7803c81593e517408631f8375ab2c Reviewed-on: https://code.wireshark.org/review/5596 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-03start dissecting the mvhd boxMartin Kaiser1-3/+84
Change-Id: I66c1973daa89690f6aaa10891408e93e886875ea Reviewed-on: https://code.wireshark.org/review/5595 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-09-27Eliminate proto_tree_add_text from some dissectors.Michael Mann1-2/+11
Some other related cleanup. Change-Id: I45f54032aa8318858f4ee784945b6f2ed163b6ea Reviewed-on: https://code.wireshark.org/review/4328 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-25Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+1
Change-Id: I19df790d18e71d45df28dc6e8731cd2e1acb098b Reviewed-on: https://code.wireshark.org/review/3826 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-24add the flags to all FullBoxesMartin Kaiser1-5/+15
Change-Id: I6e0109bc1d1acf200fd0c1a9f8ddd3a3d98f5908 Reviewed-on: https://code.wireshark.org/review/3189 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-24start dissecting the MP4 stsd boxMartin Kaiser1-0/+46
Change-Id: I589a6ced098d1d224e86386f028c92fc0797164e Reviewed-on: https://code.wireshark.org/review/3188 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-24dissect the MP4 url boxMartin Kaiser1-0/+40
Change-Id: Ibeaf5ba5d104e7f9bc9291e83923f8675abf0099 Reviewed-on: https://code.wireshark.org/review/3187 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-24dissect the MP4 dref boxMartin Kaiser1-1/+44
Change-Id: I342f283bbab3052337e00502769150cf3f4a8800 Reviewed-on: https://code.wireshark.org/review/3186 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-24dissect the MP4 hdlr boxMartin Kaiser1-0/+45
Change-Id: I467bfae2db7d3a119b58505b43b3d9bb59615ee9 Reviewed-on: https://code.wireshark.org/review/3185 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-11Strip some trailing whitespace; Fix some indentation; Add editor-modelines ↵Bill Meier1-1/+1
as needed. Change-Id: I943153e28f468070d86535abad7be032e1386118 Reviewed-on: https://code.wireshark.org/review/2994 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-22convert to proto_tree_add_subtree[_format]Michael Mann1-2/+1
Change-Id: I358bfaa4e5d40cd01b766f614f8bd0dbaf611dd0 Reviewed-on: https://code.wireshark.org/review/2508 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-29dissect more components of the track header boxMartin Kaiser1-3/+94
Change-Id: If8d35122ce096f52837bdff1c6599b47456697d5 Reviewed-on: https://code.wireshark.org/review/1858 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>