1 /*
2 * Copyright (c) 2004 Roman Shaposhnik
3 * Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com)
4 *
5 * Many thanks to Steven M. Schultz for providing clever ideas and
6 * to Michael Niedermayer <michaelni@gmx.at> for writing initial
7 * implementation.
8 *
9 * This file is part of FFmpeg.
10 *
11 * FFmpeg is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * FFmpeg is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with FFmpeg; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26 /**
27 * @file
28 * Multithreading support functions
29 * @see doc/multithreading.txt
30 */
31
36
37 /**
38 * Set the threading algorithms used.
39 *
40 * Threading requires more than one thread.
41 * Frame threading requires entire frames to be passed to the codec,
42 * and introduces extra decoding delay, so is incompatible with low_delay.
43 *
44 * @param avctx The context.
45 */
47 {
62 }
63
66 "Application has requested %d threads. Using a thread count greater than %d is not recommended.\n",
68 }
69
71 {
73
78
79 return 0;
80 }
81
83 {
86 else
88 }
const struct AVCodec * codec
#define AV_LOG_WARNING
Something somehow does not look correct.
void ff_slice_thread_free(AVCodecContext *avctx)
#define AV_CODEC_FLAG2_CHUNKS
Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries...
#define AV_CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
static void validate_thread_parameters(AVCodecContext *avctx)
Set the threading algorithms used.
Multithreading support functions.
#define AV_CODEC_FLAG_LOW_DELAY
Force low delay.
int ff_thread_init(AVCodecContext *avctx)
void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
int active_thread_type
Which multithreading methods are in use by the codec.
int capabilities
Codec capabilities.
int flags
AV_CODEC_FLAG_*.
void ff_thread_free(AVCodecContext *avctx)
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
#define FF_THREAD_FRAME
Decode more than one frame at once.
#define FF_THREAD_SLICE
Decode more than one part of a single frame at once.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Libavcodec external API header.
main external API structure.
int ff_slice_thread_init(AVCodecContext *avctx)
common internal api header.
int flags2
AV_CODEC_FLAG2_*.
#define AV_CODEC_FLAG_TRUNCATED
Input bitstream might be truncated at a random location instead of only at frame boundaries.
int ff_frame_thread_init(AVCodecContext *avctx)
int thread_type
Which multithreading methods to use.