summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2011-12-07 10:43:28 +0000
committerNanang Izzuddin <nanang@teluu.com>2011-12-07 10:43:28 +0000
commit2ba3536e2d318130242c35ed053aaae7f771b261 (patch)
tree564da2c0e0a5b2b2fef7a50342286727eb825662 /pjmedia/include
parent3a0786774a23558b8da85fd261b2858995c2c999 (diff)
Re #1234: Initial version of keyframe request/response via SIP INFO.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3901 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia/errno.h5
-rw-r--r--pjmedia/include/pjmedia/event.h24
-rw-r--r--pjmedia/include/pjmedia/vid_codec.h47
-rw-r--r--pjmedia/include/pjmedia/vid_stream.h23
4 files changed, 70 insertions, 29 deletions
diff --git a/pjmedia/include/pjmedia/errno.h b/pjmedia/include/pjmedia/errno.h
index 4f3a6c3e..3c27e35f 100644
--- a/pjmedia/include/pjmedia/errno.h
+++ b/pjmedia/include/pjmedia/errno.h
@@ -346,6 +346,11 @@ PJ_BEGIN_DECL
* Invalid mode.
*/
#define PJMEDIA_CODEC_EINMODE (PJMEDIA_ERRNO_START+86) /* 220086 */
+/**
+ * @hideinitializer
+ * Bad or corrupted bitstream.
+ */
+#define PJMEDIA_CODEC_EBADBITSTREAM (PJMEDIA_ERRNO_START+87) /* 220087 */
/************************************************************
diff --git a/pjmedia/include/pjmedia/event.h b/pjmedia/include/pjmedia/event.h
index 7a779e79..ba06625c 100644
--- a/pjmedia/include/pjmedia/event.h
+++ b/pjmedia/include/pjmedia/event.h
@@ -70,14 +70,14 @@ typedef enum pjmedia_event_type
PJMEDIA_EVENT_MOUSE_BTN_DOWN = PJMEDIA_FOURCC('M', 'S', 'D', 'N'),
/**
- * Video key frame has just been decoded event.
+ * Video keyframe has just been decoded event.
*/
- PJMEDIA_EVENT_KEY_FRAME_FOUND = PJMEDIA_FOURCC('I', 'F', 'R', 'F'),
+ PJMEDIA_EVENT_KEYFRAME_FOUND = PJMEDIA_FOURCC('I', 'F', 'R', 'F'),
/**
- * Video decoding error due to missing key frame event.
+ * Video decoding error due to missing keyframe event.
*/
- PJMEDIA_EVENT_KEY_FRAME_MISSING = PJMEDIA_FOURCC('I', 'F', 'R', 'M'),
+ PJMEDIA_EVENT_KEYFRAME_MISSING = PJMEDIA_FOURCC('I', 'F', 'R', 'M'),
/**
* Video orientation has been changed event.
@@ -135,11 +135,11 @@ typedef pjmedia_event_dummy_data pjmedia_event_wnd_closed_data;
/** Additional parameters for mouse button down event */
typedef pjmedia_event_dummy_data pjmedia_event_mouse_btn_down_data;
-/** Additional parameters for key frame found event */
-typedef pjmedia_event_dummy_data pjmedia_event_key_frame_found_data;
+/** Additional parameters for keyframe found event */
+typedef pjmedia_event_dummy_data pjmedia_event_keyframe_found_data;
-/** Additional parameters for key frame missing event */
-typedef pjmedia_event_dummy_data pjmedia_event_key_frame_missing_data;
+/** Additional parameters for keyframe missing event */
+typedef pjmedia_event_dummy_data pjmedia_event_keyframe_missing_data;
/**
* Maximum size of additional parameters section in pjmedia_event structure
@@ -205,11 +205,11 @@ typedef struct pjmedia_event
/** Mouse button down event data */
pjmedia_event_mouse_btn_down_data mouse_btn_down;
- /** Key frame found event data */
- pjmedia_event_key_frame_found_data key_frm_found;
+ /** Keyframe found event data */
+ pjmedia_event_keyframe_found_data keyframe_found;
- /** Key frame missing event data */
- pjmedia_event_key_frame_missing_data key_frm_missing;
+ /** Keyframe missing event data */
+ pjmedia_event_keyframe_missing_data keyframe_missing;
/** Storage for user event data */
pjmedia_event_user_data user;
diff --git a/pjmedia/include/pjmedia/vid_codec.h b/pjmedia/include/pjmedia/vid_codec.h
index 9716e540..6029f91e 100644
--- a/pjmedia/include/pjmedia/vid_codec.h
+++ b/pjmedia/include/pjmedia/vid_codec.h
@@ -76,6 +76,37 @@ typedef enum pjmedia_vid_packing
} pjmedia_vid_packing;
+
+/**
+ * Enumeration of video frame info flag for the bit_info field in the
+ * pjmedia_frame.
+ */
+typedef enum pjmedia_vid_frm_bit_info
+{
+ /**
+ * The video frame is keyframe.
+ */
+ PJMEDIA_VID_FRM_KEYFRAME = 1
+
+} pjmedia_vid_frm_bit_info;
+
+
+/**
+ * Encoding option.
+ */
+typedef struct pjmedia_vid_encode_opt
+{
+ /**
+ * Flag to force the encoder to generate keyframe for the specified input
+ * frame. When this flag is set, application can verify the result by
+ * examining PJMEDIA_VID_FRM_KEYFRAME flag in the bit_info field of the
+ * output frame.
+ */
+ pj_bool_t force_keyframe;
+
+} pjmedia_vid_encode_opt;
+
+
/**
* Identification used to search for codec factory that supports specific
* codec specification.
@@ -178,7 +209,7 @@ typedef struct pjmedia_vid_codec_op
/**
* See #pjmedia_vid_codec_modify().
*/
- pj_status_t (*modify)(pjmedia_vid_codec *codec,
+ pj_status_t (*modify)(pjmedia_vid_codec *codec,
const pjmedia_vid_codec_param *param);
/**
@@ -191,6 +222,7 @@ typedef struct pjmedia_vid_codec_op
* See #pjmedia_vid_codec_encode_begin().
*/
pj_status_t (*encode_begin)(pjmedia_vid_codec *codec,
+ const pjmedia_vid_encode_opt *opt,
const pjmedia_frame *input,
unsigned out_size,
pjmedia_frame *output,
@@ -363,15 +395,6 @@ typedef struct pjmedia_vid_codec_mgr pjmedia_vid_codec_mgr;
/**
- * Initialize pjmedia_vid_codec structure with default values.
- *
- * @param codec The codec to be initialized.
- * @param sig Codec's object signature (see signatures.h)
- */
-PJ_DECL(void) pjmedia_vid_codec_reset(pjmedia_vid_codec *codec,
- pjmedia_obj_sig sig);
-
-/**
* Initialize codec manager. If there is no the default video codec manager,
* this function will automatically set the default video codec manager to
* the new codec manager instance. Normally this function is called by pjmedia
@@ -728,6 +751,7 @@ pjmedia_vid_codec_get_param(pjmedia_vid_codec *codec,
* codec.
*
* @param codec The codec instance.
+ * @param opt Optional encoding options.
* @param input The input frame.
* @param out_size The length of buffer in the output frame. This
* should be at least the same as the configured
@@ -741,12 +765,13 @@ pjmedia_vid_codec_get_param(pjmedia_vid_codec *codec,
*/
PJ_INLINE(pj_status_t)
pjmedia_vid_codec_encode_begin( pjmedia_vid_codec *codec,
+ const pjmedia_vid_encode_opt *opt,
const pjmedia_frame *input,
unsigned out_size,
pjmedia_frame *output,
pj_bool_t *has_more)
{
- return (*codec->op->encode_begin)(codec, input, out_size, output,
+ return (*codec->op->encode_begin)(codec, opt, input, out_size, output,
has_more);
}
diff --git a/pjmedia/include/pjmedia/vid_stream.h b/pjmedia/include/pjmedia/vid_stream.h
index bdd84079..4ce819bd 100644
--- a/pjmedia/include/pjmedia/vid_stream.h
+++ b/pjmedia/include/pjmedia/vid_stream.h
@@ -298,10 +298,10 @@ PJ_DECL(pj_bool_t) pjmedia_vid_stream_is_running(pjmedia_vid_stream *stream,
pjmedia_dir dir);
/**
- * Pause the individual channel in the stream.
+ * Pause stream channels.
*
- * @param stream The video channel.
- * @param dir Which direction to pause.
+ * @param stream The video stream.
+ * @param dir Which channel direction to pause.
*
* @return PJ_SUCCESS on success.
*/
@@ -309,10 +309,10 @@ PJ_DECL(pj_status_t) pjmedia_vid_stream_pause(pjmedia_vid_stream *stream,
pjmedia_dir dir);
/**
- * Resume the individual channel in the stream.
+ * Resume stream channels.
*
- * @param stream The video channel.
- * @param dir Which direction to resume.
+ * @param stream The video stream.
+ * @param dir Which channel direction to resume.
*
* @return PJ_SUCCESS on success;
*/
@@ -321,6 +321,17 @@ PJ_DECL(pj_status_t) pjmedia_vid_stream_resume(pjmedia_vid_stream *stream,
/**
+ * Force stream to send video keyframe on the next transmission.
+ *
+ * @param stream The video stream.
+ *
+ * @return PJ_SUCCESS on success;
+ */
+PJ_DECL(pj_status_t) pjmedia_vid_stream_send_keyframe(
+ pjmedia_vid_stream *stream);
+
+
+/**
* @}
*/