summaryrefslogtreecommitdiff
path: root/libavformat/smoothstreamingenc.c
Commit message (Collapse)AuthorAge
* Mark read-only tables as staticDiego Biurrun2016-05-05
|
* avio: Copy URLContext generic options into child URLContextsMartin Storsjö2016-03-24
| | | | | | | | | | | | | | | Since all URLContexts have the same AVOptions, such AVOptions will be applied on the outermost context only and removed from the dict, while they probably make sense on all contexts. This makes sure that rw_timeout gets propagated to the innermost URLContext (to make sure it gets passed to the tcp protocol, when opening a http connection for instance). Alternatively, such matching options would be kept in the dict and only removed after the ffurl_connect call. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* lavf: add a protocol whitelist/blacklist for file opened internallyAnton Khirnov2016-02-22
| | | | | | | | Should make the default behaviour safer for careless callers that open random untrusted files. Bug-Id: CVE-2016-1897 Bug-Id: CVE-2016-1898
* urlprotocol: receive a list of protocols from the callerAnton Khirnov2016-02-22
| | | | | This way, the decisions about which protocols are available for use in any given situations can be delegated to the caller.
* smoothstreamingenc: do not open the files as read+writeAnton Khirnov2016-02-22
| | | | They are only written to, never read.
* lavf: allow custom IO for all filesAnton Khirnov2016-01-24
| | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
* avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
|
* smoothstreamingenc: Add a missing "goto fail"Michael Niedermayer2015-01-19
| | | | | | | | This goto wasn't necessary originally, but it should have been added when the write_manifest call was added in 8e276378. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* Revert "lavf: Don't try to update files atomically with renames on windows"Martin Storsjö2014-11-27
| | | | | | | | | This reverts commit b9d08c77a44390b0848c06f20bc0e9e951ba6a3c. After taking MoveFileEx into use, we can replace files with renames on windows as well. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Don't try to update files atomically with renames on windowsMartin Storsjö2014-11-24
| | | | | | | | | On windows, rename(2) will fail if the target file exists. On unix this trick is used to make sure that people reading the file either will get the full previous file, or the full new version of the file, but no intermediate version. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: replace rename() with ff_rename()Luca Barbato2014-10-24
| | | | | | | | | The new function wraps errno so that its value is correctly reported when other functions overwrite it (eg. in case of logging). CC: libav-stable@libav.org Bug-Id: CID 1135748 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* smoothstreamingenc: explict cast to avoid overflowVittorio Giovara2014-10-21
| | | | | CC: libav-stable@libav.org Bug-Id: CID 732248
* smoothstreamingenc: Simplify code by removing a redundant variableMartin Storsjö2014-10-12
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Set the stream time base hint properly for chained muxersMartin Storsjö2014-10-06
| | | | | | | This avoids warnings about using the codec time base as time base hint. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Check mkdir return error codesMartin Storsjö2014-09-07
| | | | | | | | | | | | | Previously, the returned error codes were intentionally ignored (see fadd3a68213), to avoid aborting if the directory already existed. If the mkdir actually failed, this was caught when opening files within the directory fails anyway. By handling the error code here (but explicitly ignoring EEXIST), the error messages and return codes in these cases are more appropriate and less confusing. Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstreamingenc: Fix a memory leak on errorsMichael Niedermayer2014-07-07
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstream: check malloc callsNidhi Makhijani2014-05-24
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf: Reset the entry count and allocation size variables on av_reallocp ↵Martin Storsjö2013-09-26
| | | | | | | | | | | | | | failures When av_reallocp fails, the associated variables that keep track of the number of elements in the array (and in some cases, the separate number of allocated elements) need to be reset. Not all of these might technically be needed, but it's better to reset them if in doubt, to make sure variables don't end up conflicting. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat: Use av_reallocp() where suitableAlexandra Khirnova2013-09-18
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* smoothstreamingenc: Write to a temp file while updating the manifestMartin Storsjö2013-08-27
| | | | | | | | If a client tries to read the file while it's being updated, the client would get an incomplete manifest. Instead write to a separate temp file and atomically rename it to replace the previous one. Signed-off-by: Martin Storsjö <martin@martin.st>
* miscellaneous typo fixesDiego Biurrun2012-12-21
|
* smoothstreamingenc: Don't assume streams start from timestamp 0Martin Storsjö2012-10-24
| | | | | | Also use dts instead of pts for deciding where to split fragments. Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstreamingenc: Add a more verbose error messageMartin Storsjö2012-10-06
| | | | | | This helps tracking down the cause if this happens to be an issue. Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstreamingenc: Ignore the return value from mkdirMartin Storsjö2012-10-06
| | | | | | | | We don't need to return an error if the directory already existed. We make sure that the directory actually is properly writeable later within ism_write_header by writing a manifest anyway. Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstreamingenc: Try writing a manifest when opening the muxerMartin Storsjö2012-10-06
| | | | | | | This allows failing cleaner and earlier if unable to write to the output directory. Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstreamingenc: Move the output_chunk_list and write_manifest functions upMartin Storsjö2012-10-06
| | | | | | | This allows calling write_manifest from ism_write_header without a forward declaration. Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstreamingenc: Properly return errors from ism_flush to the callerMartin Storsjö2012-10-06
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstreamingenc: Check the output UrlContext before accessing itMartin Storsjö2012-10-06
| | | | | | | This code can be called with a NULL UrlContext if writing of the trailer involves seeking. Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstreamingenc: Copy the SAR on the AVStreams as wellMartin Storsjö2012-09-23
| | | | | | This is required in chained muxers, if the SAR happens to be set. Signed-off-by: Martin Storsjö <martin@martin.st>
* smoothstreaming: Export the mp4 codec tagsMartin Storsjö2012-09-18
| | | | | | | | | This fixes stream copy from a format that already has incompatible codec tags set. The chained ismv muxer exports this same codec tag list, so set it on this one as well, to allow the caller (and lavf common code) to set them correctly. Signed-off-by: Martin Storsjö <martin@martin.st>
* Add a smooth streaming segmenter muxerMartin Storsjö2012-09-12
This muxer splits the output from the ismv muxer into individual files, in realtime. The same can also be done by the standalone tool ismindex, but this muxer is needed for doing it in realtime (especially for live streams that need extra handling for updating the lookahead fields in the fragment headers). Using this muxer, one can deliver live smooth streaming from a normal static file web server. (Using ismindex, one can deliver premade smooth streaming files from a static file web server, or prepare files for serving with IIS.) Signed-off-by: Martin Storsjö <martin@martin.st>