1
/* $Id: vid_codec.h 3956 2012-02-21 08:31:26Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJMEDIA_VID_CODEC_H__
21
#define __PJMEDIA_VID_CODEC_H__
26
* @brief Video codec framework.
29
#include <pjmedia/codec.h>
30
#include <pjmedia/event.h>
31
#include <pjmedia/format.h>
32
#include <pjmedia/types.h>
39
* @defgroup PJMEDIA_VID_CODEC Video Codecs
40
* @ingroup PJMEDIA_CODEC
44
#define PJMEDIA_VID_CODEC_MAX_DEC_FMT_CNT 8
45
#define PJMEDIA_VID_CODEC_MAX_FPS_CNT 16
48
* This enumeration specifies the packetization property of video encoding
49
* process. The value is bitmask, and smaller value will have higher priority
52
typedef enum pjmedia_vid_packing
55
* This specifies that the packetization is unknown, or if nothing
58
PJMEDIA_VID_PACKING_UNKNOWN,
61
* This specifies that the result of video encoding process will be
62
* segmented into packets, which is suitable for RTP transmission.
63
* The maximum size of the packets is set in \a enc_mtu field of
64
* pjmedia_vid_codec_param.
66
PJMEDIA_VID_PACKING_PACKETS = 1,
69
* This specifies that video encoding function will produce a whole
70
* or full frame from the source frame. This is normally used for
71
* encoding video for offline storage such as to an AVI file. The
72
* maximum size of the packets is set in \a enc_mtu field of
73
* pjmedia_vid_codec_param.
75
PJMEDIA_VID_PACKING_WHOLE = 2
77
} pjmedia_vid_packing;
81
* Enumeration of video frame info flag for the bit_info field in the
84
typedef enum pjmedia_vid_frm_bit_info
87
* The video frame is keyframe.
89
PJMEDIA_VID_FRM_KEYFRAME = 1
91
} pjmedia_vid_frm_bit_info;
97
typedef struct pjmedia_vid_encode_opt
100
* Flag to force the encoder to generate keyframe for the specified input
101
* frame. When this flag is set, application can verify the result by
102
* examining PJMEDIA_VID_FRM_KEYFRAME flag in the bit_info field of the
105
pj_bool_t force_keyframe;
107
} pjmedia_vid_encode_opt;
111
* Identification used to search for codec factory that supports specific
112
* codec specification.
114
typedef struct pjmedia_vid_codec_info
116
pjmedia_format_id fmt_id; /**< Encoded format ID */
117
unsigned pt; /**< Payload type */
118
pj_str_t encoding_name; /**< Encoding name */
119
pj_str_t encoding_desc; /**< Encoding desc */
120
unsigned clock_rate; /**< Clock rate */
121
pjmedia_dir dir; /**< Direction */
122
unsigned dec_fmt_id_cnt; /**< # of supported encoding source
124
pjmedia_format_id dec_fmt_id[PJMEDIA_VID_CODEC_MAX_DEC_FMT_CNT];
125
/**< Supported encoding source
127
unsigned packings; /**< Supported or requested packings,
128
strategies, bitmask from
129
pjmedia_vid_packing */
130
unsigned fps_cnt; /**< # of supported frame-rates, can be
131
zero (support any frame-rate) */
132
pjmedia_ratio fps[PJMEDIA_VID_CODEC_MAX_FPS_CNT];
133
/**< Supported frame-rates */
135
} pjmedia_vid_codec_info;
139
* Detailed codec attributes used in configuring a codec and in querying
140
* the capability of codec factories. Default attributes of any codecs could
141
* be queried using #pjmedia_vid_codec_mgr_get_default_param() and modified
142
* using #pjmedia_vid_codec_mgr_set_default_param().
144
* Please note that codec parameter also contains SDP specific setting,
145
* #dec_fmtp and #enc_fmtp, which may need to be set appropriately based on
146
* the effective setting. See each codec documentation for more detail.
148
typedef struct pjmedia_vid_codec_param
150
pjmedia_dir dir; /**< Direction */
151
pjmedia_vid_packing packing; /**< Packetization strategy. */
153
pjmedia_format enc_fmt; /**< Encoded format */
154
pjmedia_codec_fmtp enc_fmtp; /**< Encoder fmtp params */
155
unsigned enc_mtu; /**< MTU or max payload size setting*/
157
pjmedia_format dec_fmt; /**< Decoded format */
158
pjmedia_codec_fmtp dec_fmtp; /**< Decoder fmtp params */
160
pj_bool_t ignore_fmtp; /**< Ignore fmtp params. If set to
161
PJ_TRUE, the codec will apply
162
format settings specified in
163
enc_fmt and dec_fmt only. */
165
} pjmedia_vid_codec_param;
169
* Duplicate video codec parameter.
171
* @param pool The pool.
172
* @param src The video codec parameter to be duplicated.
174
* @return Duplicated codec parameter.
176
PJ_DECL(pjmedia_vid_codec_param*) pjmedia_vid_codec_param_clone(
178
const pjmedia_vid_codec_param *src);
181
* Forward declaration for video codec.
183
typedef struct pjmedia_vid_codec pjmedia_vid_codec;
187
* This structure describes codec operations. Each codec MUST implement
188
* all of these functions.
190
typedef struct pjmedia_vid_codec_op
193
* See #pjmedia_vid_codec_init().
195
pj_status_t (*init)(pjmedia_vid_codec *codec,
199
* See #pjmedia_vid_codec_open().
201
pj_status_t (*open)(pjmedia_vid_codec *codec,
202
pjmedia_vid_codec_param *param );
205
* See #pjmedia_vid_codec_close().
207
pj_status_t (*close)(pjmedia_vid_codec *codec);
210
* See #pjmedia_vid_codec_modify().
212
pj_status_t (*modify)(pjmedia_vid_codec *codec,
213
const pjmedia_vid_codec_param *param);
216
* See #pjmedia_vid_codec_get_param().
218
pj_status_t (*get_param)(pjmedia_vid_codec *codec,
219
pjmedia_vid_codec_param *param);
222
* See #pjmedia_vid_codec_encode_begin().
224
pj_status_t (*encode_begin)(pjmedia_vid_codec *codec,
225
const pjmedia_vid_encode_opt *opt,
226
const pjmedia_frame *input,
228
pjmedia_frame *output,
229
pj_bool_t *has_more);
232
* See #pjmedia_vid_codec_encode_more()
234
pj_status_t (*encode_more)(pjmedia_vid_codec *codec,
236
pjmedia_frame *output,
237
pj_bool_t *has_more);
241
* See #pjmedia_vid_codec_decode().
243
pj_status_t (*decode)(pjmedia_vid_codec *codec,
245
pjmedia_frame packets[],
247
pjmedia_frame *output);
250
* See #pjmedia_vid_codec_recover()
252
pj_status_t (*recover)(pjmedia_vid_codec *codec,
254
pjmedia_frame *output);
256
} pjmedia_vid_codec_op;
261
* Forward declaration for pjmedia_vid_codec_factory.
263
typedef struct pjmedia_vid_codec_factory pjmedia_vid_codec_factory;
267
* This structure describes a video codec instance. Codec implementers
268
* should use #pjmedia_vid_codec_init() to initialize this structure with
271
struct pjmedia_vid_codec
273
/** Entries to put this codec instance in codec factory's list. */
274
PJ_DECL_LIST_MEMBER(struct pjmedia_vid_codec);
276
/** Codec's private data. */
279
/** Codec factory where this codec was allocated. */
280
pjmedia_vid_codec_factory *factory;
282
/** Operations to codec. */
283
pjmedia_vid_codec_op *op;
289
* This structure describes operations that must be supported by codec
292
typedef struct pjmedia_vid_codec_factory_op
295
* Check whether the factory can create codec with the specified
298
* @param factory The codec factory.
299
* @param info The codec info.
301
* @return PJ_SUCCESS if this factory is able to create an
302
* instance of codec with the specified info.
304
pj_status_t (*test_alloc)(pjmedia_vid_codec_factory *factory,
305
const pjmedia_vid_codec_info *info );
308
* Create default attributes for the specified codec ID. This function
309
* can be called by application to get the capability of the codec.
311
* @param factory The codec factory.
312
* @param info The codec info.
313
* @param attr The attribute to be initialized.
315
* @return PJ_SUCCESS if success.
317
pj_status_t (*default_attr)(pjmedia_vid_codec_factory *factory,
318
const pjmedia_vid_codec_info *info,
319
pjmedia_vid_codec_param *attr );
322
* Enumerate supported codecs that can be created using this factory.
324
* @param factory The codec factory.
325
* @param count On input, specifies the number of elements in
326
* the array. On output, the value will be set to
327
* the number of elements that have been initialized
329
* @param info The codec info array, which contents will be
330
* initialized upon return.
332
* @return PJ_SUCCESS on success.
334
pj_status_t (*enum_info)(pjmedia_vid_codec_factory *factory,
336
pjmedia_vid_codec_info codecs[]);
339
* Create one instance of the codec with the specified codec info.
341
* @param factory The codec factory.
342
* @param info The codec info.
343
* @param p_codec Pointer to receive the codec instance.
345
* @return PJ_SUCCESS on success.
347
pj_status_t (*alloc_codec)(pjmedia_vid_codec_factory *factory,
348
const pjmedia_vid_codec_info *info,
349
pjmedia_vid_codec **p_codec);
352
* This function is called by codec manager to return a particular
353
* instance of codec back to the codec factory.
355
* @param factory The codec factory.
356
* @param codec The codec instance to be returned.
358
* @return PJ_SUCCESS on success.
360
pj_status_t (*dealloc_codec)(pjmedia_vid_codec_factory *factory,
361
pjmedia_vid_codec *codec );
363
} pjmedia_vid_codec_factory_op;
368
* Codec factory describes a module that is able to create codec with specific
369
* capabilities. These capabilities can be queried by codec manager to create
370
* instances of codec.
372
struct pjmedia_vid_codec_factory
374
/** Entries to put this structure in the codec manager list. */
375
PJ_DECL_LIST_MEMBER(struct pjmedia_vid_codec_factory);
377
/** The factory's private data. */
380
/** Operations to the factory. */
381
pjmedia_vid_codec_factory_op *op;
387
* Opaque declaration for codec manager.
389
typedef struct pjmedia_vid_codec_mgr pjmedia_vid_codec_mgr;
392
* Declare maximum codecs
394
#define PJMEDIA_VID_CODEC_MGR_MAX_CODECS 32
398
* Initialize codec manager. If there is no the default video codec manager,
399
* this function will automatically set the default video codec manager to
400
* the new codec manager instance. Normally this function is called by pjmedia
401
* endpoint's initialization code.
403
* @param pool The pool instance.
404
* @param mgr The pointer to the new codec manager instance.
406
* @return PJ_SUCCESS on success.
408
PJ_DECL(pj_status_t) pjmedia_vid_codec_mgr_create(pj_pool_t *pool,
409
pjmedia_vid_codec_mgr **mgr);
413
* Destroy codec manager. Normally this function is called by pjmedia
414
* endpoint's deinitialization code.
416
* @param mgr Codec manager instance. If NULL, it is the default codec
417
* manager instance will be destroyed.
419
* @return PJ_SUCCESS on success.
421
PJ_DECL(pj_status_t) pjmedia_vid_codec_mgr_destroy(pjmedia_vid_codec_mgr *mgr);
425
* Get the default codec manager instance.
427
* @return The default codec manager instance or NULL if none.
429
PJ_DECL(pjmedia_vid_codec_mgr*) pjmedia_vid_codec_mgr_instance(void);
433
* Set the default codec manager instance.
435
* @param mgr The codec manager instance.
437
PJ_DECL(void) pjmedia_vid_codec_mgr_set_instance(pjmedia_vid_codec_mgr* mgr);
441
* Register codec factory to codec manager. This will also register
442
* all supported codecs in the factory to the codec manager.
444
* @param mgr The codec manager instance. If NULL, the default codec
445
* manager instance will be used.
446
* @param factory The codec factory to be registered.
448
* @return PJ_SUCCESS on success.
451
pjmedia_vid_codec_mgr_register_factory( pjmedia_vid_codec_mgr *mgr,
452
pjmedia_vid_codec_factory *factory);
455
* Unregister codec factory from the codec manager. This will also
456
* remove all the codecs registered by the codec factory from the
457
* codec manager's list of supported codecs.
459
* @param mgr The codec manager instance. If NULL, the default codec
460
* manager instance will be used.
461
* @param factory The codec factory to be unregistered.
463
* @return PJ_SUCCESS on success.
466
pjmedia_vid_codec_mgr_unregister_factory( pjmedia_vid_codec_mgr *mgr,
467
pjmedia_vid_codec_factory *factory);
470
* Enumerate all supported codecs that have been registered to the
471
* codec manager by codec factories.
473
* @param mgr The codec manager instance. If NULL, the default codec
474
* manager instance will be used.
475
* @param count On input, specifies the number of elements in
476
* the array. On output, the value will be set to
477
* the number of elements that have been initialized
479
* @param info The codec info array, which contents will be
480
* initialized upon return.
481
* @param prio Optional pointer to receive array of codec priorities.
483
* @return PJ_SUCCESS on success.
486
pjmedia_vid_codec_mgr_enum_codecs(pjmedia_vid_codec_mgr *mgr,
488
pjmedia_vid_codec_info info[],
493
* Get codec info for the specified payload type. The payload type must be
494
* static or locally defined in #pjmedia_video_pt.
496
* @param mgr The codec manager instance. If NULL, the default codec
497
* manager instance will be used.
498
* @param pt The payload type/number.
499
* @param info Pointer to receive codec info.
501
* @return PJ_SUCCESS on success.
504
pjmedia_vid_codec_mgr_get_codec_info( pjmedia_vid_codec_mgr *mgr,
506
const pjmedia_vid_codec_info **info);
510
* Get codec info for the specified format ID.
512
* @param mgr The codec manager instance. If NULL, the default codec
513
* manager instance will be used.
514
* @param fmt_id Format ID. See #pjmedia_format_id
515
* @param info Pointer to receive codec info.
517
* @return PJ_SUCCESS on success.
520
pjmedia_vid_codec_mgr_get_codec_info2(pjmedia_vid_codec_mgr *mgr,
521
pjmedia_format_id fmt_id,
522
const pjmedia_vid_codec_info **info);
526
* Convert codec info struct into a unique codec identifier.
527
* A codec identifier looks something like "H263/90000".
529
* @param info The codec info
530
* @param id Buffer to put the codec info string.
531
* @param max_len The length of the buffer.
533
* @return The null terminated codec info string, or NULL if
534
* the buffer is not long enough.
536
PJ_DECL(char*) pjmedia_vid_codec_info_to_id(const pjmedia_vid_codec_info *info,
537
char *id, unsigned max_len );
541
* Find codecs by the unique codec identifier. This function will find
542
* all codecs that match the codec identifier prefix. For example, if
543
* "H26" is specified, then it will find "H263/90000", "H264/90000",
544
* and so on, up to the maximum count specified in the argument.
546
* @param mgr The codec manager instance. If NULL, the default codec
547
* manager instance will be used.
548
* @param codec_id The full codec ID or codec ID prefix. If an empty
549
* string is given, it will match all codecs.
550
* @param count Maximum number of codecs to find. On return, it
551
* contains the actual number of codecs found.
552
* @param p_info Array of pointer to codec info to be filled. This
553
* argument may be NULL, which in this case, only
554
* codec count will be returned.
555
* @param prio Optional array of codec priorities.
557
* @return PJ_SUCCESS if at least one codec info is found.
560
pjmedia_vid_codec_mgr_find_codecs_by_id(pjmedia_vid_codec_mgr *mgr,
561
const pj_str_t *codec_id,
563
const pjmedia_vid_codec_info *p_info[],
568
* Set codec priority. The codec priority determines the order of
569
* the codec in the SDP created by the endpoint. If more than one codecs
570
* are found with the same codec_id prefix, then the function sets the
571
* priorities of all those codecs.
573
* @param mgr The codec manager instance. If NULL, the default codec
574
* manager instance will be used.
575
* @param codec_id The full codec ID or codec ID prefix. If an empty
576
* string is given, it will match all codecs.
577
* @param prio Priority to be set. The priority can have any value
578
* between 1 to 255. When the priority is set to zero,
579
* the codec will be disabled.
581
* @return PJ_SUCCESS if at least one codec info is found.
584
pjmedia_vid_codec_mgr_set_codec_priority(pjmedia_vid_codec_mgr *mgr,
585
const pj_str_t *codec_id,
590
* Get default codec param for the specified codec info.
592
* @param mgr The codec manager instance. If NULL, the default codec
593
* manager instance will be used.
594
* @param info The codec info, which default parameter's is being
596
* @param param On return, will be filled with the default codec
599
* @return PJ_SUCCESS on success.
602
pjmedia_vid_codec_mgr_get_default_param(pjmedia_vid_codec_mgr *mgr,
603
const pjmedia_vid_codec_info *info,
604
pjmedia_vid_codec_param *param);
608
* Set default codec param for the specified codec info.
610
* @param mgr The codec manager instance. If NULL, the default codec
611
* manager instance will be used.
612
* @param pool The pool instance.
613
* @param info The codec info, which default parameter's is being
615
* @param param The new default codec parameter. Set to NULL to reset
616
* codec parameter to library default settings.
618
* @return PJ_SUCCESS on success.
621
pjmedia_vid_codec_mgr_set_default_param(pjmedia_vid_codec_mgr *mgr,
622
const pjmedia_vid_codec_info *info,
623
const pjmedia_vid_codec_param *param);
627
* Request the codec manager to allocate one instance of codec with the
628
* specified codec info. The codec will enumerate all codec factories
629
* until it finds factory that is able to create the specified codec.
631
* @param mgr The codec manager instance. If NULL, the default codec
632
* manager instance will be used.
633
* @param info The information about the codec to be created.
634
* @param p_codec Pointer to receive the codec instance.
636
* @return PJ_SUCCESS on success.
639
pjmedia_vid_codec_mgr_alloc_codec( pjmedia_vid_codec_mgr *mgr,
640
const pjmedia_vid_codec_info *info,
641
pjmedia_vid_codec **p_codec);
644
* Deallocate the specified codec instance. The codec manager will return
645
* the instance of the codec back to its factory.
647
* @param mgr The codec manager instance. If NULL, the default codec
648
* manager instance will be used.
649
* @param codec The codec instance.
651
* @return PJ_SUCESS on success.
653
PJ_DECL(pj_status_t) pjmedia_vid_codec_mgr_dealloc_codec(
654
pjmedia_vid_codec_mgr *mgr,
655
pjmedia_vid_codec *codec);
660
* Initialize codec using the specified attribute.
662
* @param codec The codec instance.
663
* @param pool Pool to use when the codec needs to allocate
666
* @return PJ_SUCCESS on success.
668
PJ_INLINE(pj_status_t) pjmedia_vid_codec_init( pjmedia_vid_codec *codec,
671
return (*codec->op->init)(codec, pool);
676
* Open the codec and initialize with the specified parameter.
677
* Upon successful initialization, the codec may modify the parameter
678
* and fills in the unspecified values (such as size or frame rate of
679
* the encoder format, as it may need to be negotiated with remote
680
* preferences via SDP fmtp).
682
* @param codec The codec instance.
683
* @param param Codec initialization parameter.
685
* @return PJ_SUCCESS on success.
687
PJ_INLINE(pj_status_t) pjmedia_vid_codec_open(pjmedia_vid_codec *codec,
688
pjmedia_vid_codec_param *param)
690
return (*codec->op->open)(codec, param);
695
* Close and shutdown codec, releasing all resources allocated by
696
* this codec, if any.
698
* @param codec The codec instance.
700
* @return PJ_SUCCESS on success.
702
PJ_INLINE(pj_status_t) pjmedia_vid_codec_close( pjmedia_vid_codec *codec )
704
return (*codec->op->close)(codec);
709
* Modify the codec parameter after the codec is open.
710
* Note that not all codec parameters can be modified during run-time.
711
* When the parameter cannot be changed, this function will return
712
* non-PJ_SUCCESS, and the original parameters will not be changed.
714
* @param codec The codec instance.
715
* @param param The new codec parameter.
717
* @return PJ_SUCCESS on success.
719
PJ_INLINE(pj_status_t)
720
pjmedia_vid_codec_modify(pjmedia_vid_codec *codec,
721
const pjmedia_vid_codec_param *param)
723
return (*codec->op->modify)(codec, param);
728
* Get the codec parameter after the codec is opened.
730
* @param codec The codec instance.
731
* @param param The codec parameter.
733
* @return PJ_SUCCESS on success.
735
PJ_INLINE(pj_status_t)
736
pjmedia_vid_codec_get_param(pjmedia_vid_codec *codec,
737
pjmedia_vid_codec_param *param)
739
return (*codec->op->get_param)(codec, param);
743
* Encode the specified input frame. The input MUST contain only one picture
744
* with the appropriate format as specified when opening the codec. Depending
745
* on the packing or packetization set in the \a packing param, the process
746
* may produce multiple encoded packets or payloads to represent the picture.
747
* This is true for example for PJMEDIA_VID_PACKING_PACKETS packing. In this
748
* case, the \a has_more field will be set to PJ_TRUE, and application should
749
* call pjmedia_vid_codec_encode_more() to get the remaining results from the
752
* @param codec The codec instance.
753
* @param opt Optional encoding options.
754
* @param input The input frame.
755
* @param out_size The length of buffer in the output frame. This
756
* should be at least the same as the configured
757
* encoding MTU of the codec.
758
* @param output The output frame.
759
* @param has_more PJ_TRUE if more payloads are available; application
760
* should then call pjmedia_vid_codec_encode_more()
761
* to retrieve the remaining results.
763
* @return PJ_SUCCESS on success;
765
PJ_INLINE(pj_status_t)
766
pjmedia_vid_codec_encode_begin( pjmedia_vid_codec *codec,
767
const pjmedia_vid_encode_opt *opt,
768
const pjmedia_frame *input,
770
pjmedia_frame *output,
773
return (*codec->op->encode_begin)(codec, opt, input, out_size, output,
778
* Retrieve more encoded packets/payloads from the codec. Application
779
* should call this function repeatedly until \a has_more flag is set
782
* @param codec The codec instance.
783
* @param out_size The length of buffer in the output frame. This
784
* should be at least the same as as the configured
785
* encoding MTU of the codec.
786
* @param output The output frame.
787
* @param has_more PJ_TRUE if more payloads are available, which in
788
* this case application should call \a encode_more()
791
* @return PJ_SUCCESS on success;
793
PJ_INLINE(pj_status_t)
794
pjmedia_vid_codec_encode_more( pjmedia_vid_codec *codec,
796
pjmedia_frame *output,
799
return (*codec->op->encode_more)(codec, out_size, output, has_more);
803
* Decode the input packets into one picture. If the packing is set to
804
* PJMEDIA_VID_PACKING_PACKETS when opening the codec, the codec is set
805
* to decode multiple encoded packets into one picture. These encoded
806
* packets are typically retrieved from the jitter buffer. If the packing
807
* is set to PJMEDIA_VID_PACKING_WHOLE, then this decode function can only
808
* accept one frame as the input.
810
* Note that the decoded picture format may different to the configured
811
* setting (i.e. the format specified in the #pjmedia_vid_codec_param when
812
* opening the codec), in this case the PJMEDIA_EVENT_FMT_CHANGED event will
813
* be emitted by the codec to notify the event. The codec parameter will
814
* also be updated, and application can query the format by using
815
* pjmedia_vid_codec_get_param().
817
* @param codec The codec instance.
818
* @param pkt_count Number of packets in the input.
819
* @param packets Array of input packets, each containing an encoded
821
* @param out_size The length of buffer in the output frame.
822
* @param output The output frame.
824
* @return PJ_SUCCESS on success;
826
PJ_INLINE(pj_status_t) pjmedia_vid_codec_decode(pjmedia_vid_codec *codec,
828
pjmedia_frame packets[],
830
pjmedia_frame *output)
832
return (*codec->op->decode)(codec, pkt_count, packets, out_size, output);
836
* Recover a missing frame.
838
* @param codec The codec instance.
839
* @param out_size The length of buffer in the output frame.
840
* @param output The output frame where generated signal
843
* @return PJ_SUCCESS on success;
845
PJ_INLINE(pj_status_t) pjmedia_vid_codec_recover(pjmedia_vid_codec *codec,
847
pjmedia_frame *output)
849
if (codec->op && codec->op->recover)
850
return (*codec->op->recover)(codec, out_size, output);
861
* @defgroup PJMEDIA_CODEC_VID_CODECS Supported video codecs
862
* @ingroup PJMEDIA_VID_CODEC
871
#endif /* __PJMEDIA_VID_CODEC_H__ */