这篇教程C++ th_info_clear函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中th_info_clear函数的典型用法代码示例。如果您正苦于以下问题:C++ th_info_clear函数的具体用法?C++ th_info_clear怎么用?C++ th_info_clear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了th_info_clear函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: noop_test_encodestatic intnoop_test_encode (){ th_info ti; th_enc_ctx *te; INFO ("+ Initializing th_info struct"); th_info_init (&ti); INFO ("+ Testing encoder context with empty th_info"); te = th_encode_alloc(&ti); if (te != NULL) FAIL("td_encode_alloc accepted an unconfigured th_info"); INFO ("+ Setting 16x16 image size"); ti.frame_width = 16; ti.frame_height = 16; INFO ("+ Allocating encoder context"); te = th_encode_alloc(&ti); if (te == NULL) FAIL("td_encode_alloc returned a null pointer"); INFO ("+ Clearing th_info struct"); th_info_clear (&ti); INFO ("+ Freeing encoder context"); th_encode_free(te); return 0;}
开发者ID:Kivutar,项目名称:love-libretro,代码行数:31,
示例2: ogg_stream_clearvoid VideoStreamTheora::clear() { if (file_name == "") return; if(vorbis_p){ ogg_stream_clear(&vo); if (vorbis_p >= 3) { vorbis_block_clear(&vb); vorbis_dsp_clear(&vd); }; vorbis_comment_clear(&vc); vorbis_info_clear(&vi); vorbis_p = 0; } if(theora_p){ ogg_stream_clear(&to); th_decode_free(td); th_comment_clear(&tc); th_info_clear(&ti); theora_p = 0; } ogg_sync_clear(&oy); file_name = ""; theora_p = 0; vorbis_p = 0; videobuf_ready = 0; frames_pending = 0; videobuf_time = 0; playing = false;};
开发者ID:0871087123,项目名称:godot,代码行数:34,
示例3: MOZ_COUNT_DTORnsTheoraState::~nsTheoraState() { MOZ_COUNT_DTOR(nsTheoraState); th_setup_free(mSetup); th_decode_free(mCtx); th_comment_clear(&mComment); th_info_clear(&mInfo);}
开发者ID:h4ck3rm1k3,项目名称:v8monkey,代码行数:7,
示例4: demuxerTheoraVideoStream::TheoraVideoStream(love::filesystem::File *file) : demuxer(file) , headerParsed(false) , decoder(nullptr) , frameReady(false) , lastFrame(0) , nextFrame(0){ if (demuxer.findStream() != OggDemuxer::TYPE_THEORA) throw love::Exception("Invalid video file, video is not theora"); th_info_init(&videoInfo); frontBuffer = new Frame(); backBuffer = new Frame(); try { parseHeader(); } catch (love::Exception &ex) { delete backBuffer; delete frontBuffer; th_info_clear(&videoInfo); throw ex; } frameSync.set(new DeltaSync(), Acquire::NORETAIN);}
开发者ID:MikuAuahDark,项目名称:livesim4,代码行数:30,
示例5: th_comment_clearTheoraDecoder::~TheoraDecoder(){ th_comment_clear(&mTheoraComment); th_info_clear(&mTheoraInfo); th_decode_free(mTheoraState); th_setup_free(mTheoraSetup);}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:8,
示例6: krad_theora_decoder_destroyvoid krad_theora_decoder_destroy(krad_theora_decoder_t *krad_theora) { th_decode_free(krad_theora->decoder); th_comment_clear(&krad_theora->comment); th_info_clear(&krad_theora->info); free(krad_theora);}
开发者ID:rillian,项目名称:krad_ebml,代码行数:8,
示例7: PR_LOG/* * Theora beginning of stream */nsresultMediaRecorder::SetupTheoraBOS(){ int i; nsresult rv; PRUint32 wr; ogg_uint32_t keyframe; if (ogg_stream_init(&vState->os, rand())) { PR_LOG(log, PR_LOG_NOTICE, ("Failed ogg_stream_init/n")); return NS_ERROR_FAILURE; } th_info_init(&vState->ti); /* Must be multiples of 16 */ vState->ti.frame_width = (params->width + 15) & ~0xF; vState->ti.frame_height = (params->height + 15) & ~0xF; vState->ti.pic_width = params->width; vState->ti.pic_height = params->height; vState->ti.pic_x = (vState->ti.frame_width - params->width) >> 1 & ~1; vState->ti.pic_y = (vState->ti.frame_height - params->height) >> 1 & ~1; vState->ti.fps_numerator = params->fps_n; vState->ti.fps_denominator = params->fps_d; /* Are these the right values? */ keyframe = 64 - 1; for (i = 0; keyframe; i++) keyframe >>= 1; vState->ti.quality = (int)(params->qual * 100); vState->ti.colorspace = TH_CS_ITU_REC_470M; vState->ti.pixel_fmt = TH_PF_420; vState->ti.keyframe_granule_shift = i; vState->th = th_encode_alloc(&vState->ti); th_info_clear(&vState->ti); /* Header init */ th_comment_init(&vState->tc); th_comment_add_tag(&vState->tc, (char *)"ENCODER", (char *)"rainbow"); if (th_encode_flushheader( vState->th, &vState->tc, &vState->op) <= 0) { PR_LOG(log, PR_LOG_NOTICE, ("Internal Theora library error/n")); return NS_ERROR_FAILURE; } th_comment_clear(&vState->tc); ogg_stream_packetin(&vState->os, &vState->op); if (ogg_stream_pageout(&vState->os, &vState->og) != 1) { PR_LOG(log, PR_LOG_NOTICE, ("Internal Ogg library error/n")); return NS_ERROR_FAILURE; } rv = WriteData(vState->og.header, vState->og.header_len, &wr); rv = WriteData(vState->og.body, vState->og.body_len, &wr); return NS_OK;}
开发者ID:1981khj,项目名称:rainbow,代码行数:61,
示例8: th_decode_freeTheoraVideoStream::~TheoraVideoStream(){ if (decoder) th_decode_free(decoder); th_info_clear(&videoInfo); delete frontBuffer; delete backBuffer;}
开发者ID:MikuAuahDark,项目名称:livesim4,代码行数:10,
示例9: CloseDecoder/***************************************************************************** * CloseDecoder: theora decoder destruction *****************************************************************************/static void CloseDecoder( vlc_object_t *p_this ){ decoder_t *p_dec = (decoder_t *)p_this; decoder_sys_t *p_sys = p_dec->p_sys; th_info_clear(&p_sys->ti); th_comment_clear(&p_sys->tc); th_decode_free(p_sys->tcx); free( p_sys );}
开发者ID:mstorsjo,项目名称:vlc,代码行数:13,
示例10: theora_enc_set_formatstatic gbooleantheora_enc_set_format (GstVideoEncoder * benc, GstVideoCodecState * state){ GstTheoraEnc *enc = GST_THEORA_ENC (benc); GstVideoInfo *info = &state->info; enc->width = GST_VIDEO_INFO_WIDTH (info); enc->height = GST_VIDEO_INFO_HEIGHT (info); th_info_clear (&enc->info); th_info_init (&enc->info); /* Theora has a divisible-by-sixteen restriction for the encoded video size but * we can define a picture area using pic_width/pic_height */ enc->info.frame_width = GST_ROUND_UP_16 (enc->width); enc->info.frame_height = GST_ROUND_UP_16 (enc->height); enc->info.pic_width = enc->width; enc->info.pic_height = enc->height; switch (GST_VIDEO_INFO_FORMAT (info)) { case GST_VIDEO_FORMAT_I420: enc->info.pixel_fmt = TH_PF_420; break; case GST_VIDEO_FORMAT_Y42B: enc->info.pixel_fmt = TH_PF_422; break; case GST_VIDEO_FORMAT_Y444: enc->info.pixel_fmt = TH_PF_444; break; default: g_assert_not_reached (); } enc->info.fps_numerator = enc->fps_n = GST_VIDEO_INFO_FPS_N (info); enc->info.fps_denominator = enc->fps_d = GST_VIDEO_INFO_FPS_D (info); enc->info.aspect_numerator = GST_VIDEO_INFO_PAR_N (info); enc->info.aspect_denominator = GST_VIDEO_INFO_PAR_D (info); enc->info.colorspace = TH_CS_UNSPECIFIED; /* Save input state */ if (enc->input_state) gst_video_codec_state_unref (enc->input_state); enc->input_state = gst_video_codec_state_ref (state); /* as done in theora */ enc->info.keyframe_granule_shift = _ilog (enc->keyframe_force - 1); GST_DEBUG_OBJECT (enc, "keyframe_frequency_force is %d, granule shift is %d", enc->keyframe_force, enc->info.keyframe_granule_shift); theora_enc_reset (enc); enc->initialised = TRUE; return TRUE;}
开发者ID:rawoul,项目名称:gst-plugins-base,代码行数:54,
示例11: uninit/* * uninit driver */static void uninit(sh_video_t *sh){ theora_struct_t *context = sh->context; if (context) { th_info_clear(&context->ti); th_comment_clear(&context->tc); th_decode_free(context->tctx); free(context); }}
开发者ID:0p1pp1,项目名称:mplayer,代码行数:14,
示例12: noop_test_infostatic intnoop_test_info (){ th_info ti; INFO ("+ Initializing th_info struct"); th_info_init (&ti); INFO ("+ Clearing empty th_info struct"); th_info_clear (&ti); return 0;}
开发者ID:Kivutar,项目名称:love-libretro,代码行数:13,
示例13: theora_dec_startstatic gbooleantheora_dec_start (GstVideoDecoder * decoder){ GstTheoraDec *dec = GST_THEORA_DEC (decoder); GST_DEBUG_OBJECT (dec, "start"); th_info_clear (&dec->info); th_comment_clear (&dec->comment); GST_DEBUG_OBJECT (dec, "Setting have_header to FALSE"); dec->have_header = FALSE; gst_theora_dec_reset (dec); return TRUE;}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:14,
示例14: ogg_stream_clearvoid VideoStreamPlaybackTheora::clear() { if (!file) return; if (vorbis_p) { ogg_stream_clear(&vo); if (vorbis_p >= 3) { vorbis_block_clear(&vb); vorbis_dsp_clear(&vd); }; vorbis_comment_clear(&vc); vorbis_info_clear(&vi); vorbis_p = 0; } if (theora_p) { ogg_stream_clear(&to); th_decode_free(td); th_comment_clear(&tc); th_info_clear(&ti); theora_p = 0; } ogg_sync_clear(&oy);#ifdef THEORA_USE_THREAD_STREAMING thread_exit = true; thread_sem->post(); //just in case Thread::wait_to_finish(thread); memdelete(thread); thread = NULL; ring_buffer.clear();#endif //file_name = ""; theora_p = 0; vorbis_p = 0; videobuf_ready = 0; frames_pending = 0; videobuf_time = 0; theora_eos = false; vorbis_eos = false; if (file) { memdelete(file); } file = NULL; playing = false;};
开发者ID:Bonfi96,项目名称:godot,代码行数:48,
示例15: theoraenc_deletevoid theoraenc_delete (TheoraEnc *enc) { if (!enc) return; if (enc->info) { th_info_clear (enc->info); free (enc->info); } if (enc->comment) { th_comment_clear (enc->comment); free (enc->comment); } if (enc->ctx) th_encode_free (enc->ctx); if (enc->postconv_buffer) free (enc->postconv_buffer); free (enc);}
开发者ID:mgorlick,项目名称:CRESTaceans,代码行数:16,
示例16: theora_enc_finalizestatic voidtheora_enc_finalize (GObject * object){ GstTheoraEnc *enc = GST_THEORA_ENC (object); GST_DEBUG_OBJECT (enc, "Finalizing"); if (enc->encoder) th_encode_free (enc->encoder); th_comment_clear (&enc->comment); th_info_clear (&enc->info); g_free (enc->multipass_cache_file); theora_enc_clear_multipass_cache (enc); G_OBJECT_CLASS (parent_class)->finalize (object);}
开发者ID:ChinnaSuhas,项目名称:ossbuild,代码行数:16,
示例17: theora_enc_get_supported_formatsstatic char *theora_enc_get_supported_formats (void){ th_enc_ctx *encoder; th_info info; struct { th_pixel_fmt pixelformat; const char *fourcc; } formats[] = { { TH_PF_420, "I420" }, { TH_PF_422, "Y42B" }, { TH_PF_444, "Y444" } }; GString *string = NULL; guint i; th_info_init (&info); info.frame_width = 16; info.frame_height = 16; info.fps_numerator = 25; info.fps_denominator = 1; for (i = 0; i < G_N_ELEMENTS (formats); i++) { info.pixel_fmt = formats[i].pixelformat; encoder = th_encode_alloc (&info); if (encoder == NULL) continue; GST_LOG ("format %s is supported", formats[i].fourcc); th_encode_free (encoder); if (string == NULL) { string = g_string_new (formats[i].fourcc); } else { g_string_append (string, ", "); g_string_append (string, formats[i].fourcc); } } th_info_clear (&info); return string == NULL ? NULL : g_string_free (string, FALSE);}
开发者ID:rawoul,项目名称:gst-plugins-base,代码行数:47,
示例18: theora_parse_change_statestatic GstStateChangeReturntheora_parse_change_state (GstElement * element, GstStateChange transition){ GstTheoraParse *parse = GST_THEORA_PARSE (element); GstStateChangeReturn ret; gint i; switch (transition) { case GST_STATE_CHANGE_READY_TO_PAUSED: th_info_init (&parse->info); th_comment_init (&parse->comment); parse->send_streamheader = TRUE; parse->buffer_queue = g_queue_new (); parse->event_queue = g_queue_new (); parse->prev_keyframe = -1; parse->prev_frame = -1; parse->granule_offset = 0; break; default: break; } ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: th_info_clear (&parse->info); th_comment_clear (&parse->comment); theora_parse_clear_queue (parse); g_queue_free (parse->buffer_queue); g_queue_free (parse->event_queue); parse->buffer_queue = NULL; for (i = 0; i < 3; i++) { if (parse->streamheader[i]) { gst_buffer_unref (parse->streamheader[i]); parse->streamheader[i] = NULL; } } parse->streamheader_received = FALSE; break; default: break; } return ret;}
开发者ID:aHuaLiu,项目名称:gst-plugins-base,代码行数:46,
示例19: close_theorastatic int close_theora(void * data) { int ret = 1; theora_t * theora; theora = data; #ifdef THEORA_1_1 if(theora->stats_file) fclose(theora->stats_file); if(theora->stats_buf) free(theora->stats_buf);#endif th_comment_clear(&theora->tc); th_info_clear(&theora->ti); th_encode_free(theora->ts); free(theora); return ret; }
开发者ID:Jheengut,项目名称:gmerlin,代码行数:19,
示例20: theora_enc_stopstatic gbooleantheora_enc_stop (GstVideoEncoder * benc){ GstTheoraEnc *enc; GST_DEBUG_OBJECT (benc, "stop: clearing theora state"); enc = GST_THEORA_ENC (benc); if (enc->encoder) { th_encode_free (enc->encoder); enc->encoder = NULL; } th_comment_clear (&enc->comment); th_info_clear (&enc->info); enc->initialised = FALSE; return TRUE;}
开发者ID:rawoul,项目名称:gst-plugins-base,代码行数:19,
示例21: krad_theora_encoder_destroyvoid krad_theora_encoder_destroy (krad_theora_encoder_t *krad_theora) { while (krad_theora->header_count--) { //printf("krad_theora_encoder_destroy freeing header %d/n", // krad_theora->header_count); free (krad_theora->header[krad_theora->header_count]); } th_info_clear (&krad_theora->info); th_comment_clear (&krad_theora->comment); th_encode_free (krad_theora->encoder); free (krad_theora->header_combined); free (krad_theora->ycbcr[0].data); free (krad_theora->ycbcr[1].data); free (krad_theora->ycbcr[2].data); free (krad_theora);}
开发者ID:kripton,项目名称:krad_radio-1,代码行数:20,
示例22: th_decode_free VideoClip_Theora::~VideoClip_Theora() { if (this->info.TheoraDecoder != NULL) { th_decode_free(this->info.TheoraDecoder); th_setup_free(this->info.TheoraSetup); if (this->audioInterface != NULL) { vorbis_dsp_clear(&this->info.VorbisDSPState); vorbis_block_clear(&this->info.VorbisBlock); } ogg_stream_clear(&this->info.TheoraStreamState); th_comment_clear(&this->info.TheoraComment); th_info_clear(&this->info.TheoraInfo); ogg_stream_clear(&this->info.VorbisStreamState); vorbis_comment_clear(&this->info.VorbisComment); vorbis_info_clear(&this->info.VorbisInfo); ogg_sync_clear(&this->info.OggSyncState); } }
开发者ID:Stratagus,项目名称:theoraplayer,代码行数:20,
示例23: th_info_init/* Generate a dummy encoder context for use in th_encode_ctl queries */th_enc_ctx *dummy_encode_ctx(void){ th_enc_ctx *ctx; th_info info; /* set the minimal video parameters */ th_info_init(&info); info.frame_width=320; info.frame_height=240; info.fps_numerator=1; info.fps_denominator=1; /* allocate and initialize a context object */ ctx = th_encode_alloc(&info); if (ctx == NULL) { fprintf(stderr, "Error allocating encoder context./n"); } /* clear the info struct */ th_info_clear(&info); return ctx;}
开发者ID:Asvarox,项目名称:Unvanquished,代码行数:24,
示例24: th_encode_free/* Generate a dummy encoder context for use in th_encode_ctl queries Release with th_encode_free() This and the next routine from theora/examples/libtheora_info.c */static th_enc_ctx *dummy_encode_ctx (void){ th_enc_ctx *ctx; th_info info; /* set the minimal video parameters */ th_info_init (&info); info.frame_width = 320; info.frame_height = 240; info.fps_numerator = 1; info.fps_denominator = 1; /* allocate and initialize a context object */ ctx = th_encode_alloc (&info); if (!ctx) GST_WARNING ("Failed to allocate dummy encoder context."); /* clear the info struct */ th_info_clear (&info); return ctx;}
开发者ID:ChinnaSuhas,项目名称:ossbuild,代码行数:26,
示例25: theora_enc_stopstatic gbooleantheora_enc_stop (GstVideoEncoder * benc){ GstTheoraEnc *enc; GST_DEBUG_OBJECT (benc, "stop: clearing theora state"); enc = GST_THEORA_ENC (benc); if (enc->encoder) th_encode_free (enc->encoder); enc->encoder = NULL; th_comment_clear (&enc->comment); th_info_clear (&enc->info); if (enc->input_state) gst_video_codec_state_unref (enc->input_state); enc->input_state = NULL; /* Everything else is handled in reset() */ theora_enc_clear_multipass_cache (enc); return TRUE;}
开发者ID:Lachann,项目名称:gst-plugins-base,代码行数:23,
示例26: theora_dec_stopstatic gbooleantheora_dec_stop (GstVideoDecoder * decoder){ GstTheoraDec *dec = GST_THEORA_DEC (decoder); GST_DEBUG_OBJECT (dec, "stop"); th_info_clear (&dec->info); th_comment_clear (&dec->comment); th_setup_free (dec->setup); dec->setup = NULL; th_decode_free (dec->decoder); dec->decoder = NULL; gst_theora_dec_reset (dec); if (dec->input_state) { gst_video_codec_state_unref (dec->input_state); dec->input_state = NULL; } if (dec->output_state) { gst_video_codec_state_unref (dec->output_state); dec->output_state = NULL; } return TRUE;}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:24,
示例27: ogg_stream_clearvoid TheoraDecoder::close() { if (_vorbisPacket) { ogg_stream_clear(&_vorbisOut); vorbis_block_clear(&_vorbisBlock); vorbis_dsp_clear(&_vorbisDSP); vorbis_comment_clear(&_vorbisComment); vorbis_info_clear(&_vorbisInfo); g_system->getMixer()->stopHandle(*_audHandle); _audStream = 0; _vorbisPacket = false; } if (_theoraPacket) { ogg_stream_clear(&_theoraOut); th_decode_free(_theoraDecode); th_comment_clear(&_theoraComment); th_info_clear(&_theoraInfo); _theoraDecode = 0; _theoraPacket = false; } if (!_fileStream) return; ogg_sync_clear(&_oggSync); delete _fileStream; _fileStream = 0; _surface.free(); _displaySurface.pixels = 0; _displaySurface.free(); reset();}
开发者ID:MathiasBartl,项目名称:scummvm,代码行数:36,
示例28: th_info_initbool CHolly_Theora_Video::Start(){ m_bFrameWaiting = false; th_info thInfo; th_info_init( &thInfo ); thInfo.frame_width = Width(); thInfo.frame_height = Height(); thInfo.pic_width = Width(); thInfo.pic_height = Height(); thInfo.pic_x = 0; thInfo.pic_y = 0; thInfo.colorspace = TH_CS_ITU_REC_470BG; thInfo.pixel_fmt = TH_PF_420; // TH_PF_444 thInfo.target_bitrate = BitRate() * 1024; thInfo.quality = 42; thInfo.keyframe_granule_shift = 6; // default value thInfo.fps_numerator = FPS(); thInfo.fps_denominator = 1; thInfo.aspect_numerator = 1; thInfo.aspect_denominator = 1; m_Encoder = th_encode_alloc( &thInfo ); if ( !m_Encoder ) { return false; } th_info_clear( &thInfo ); SetupFrame(); WriteHeader(); return true;}
开发者ID:aarong11,项目名称:holly_public,代码行数:36,
示例29: noop_test_decodestatic intnoop_test_decode (){ th_info ti; th_dec_ctx *td; INFO ("+ Testing decoder context with null info and setup"); td = th_decode_alloc(NULL, NULL); if (td != NULL) FAIL("td_decode_alloc accepted null info pointers"); INFO ("+ Initializing th_info struct"); th_info_init (&ti); INFO ("+ Testing decoder context with empty info and null setup"); td = th_decode_alloc(&ti, NULL); if (td != NULL) FAIL("td_decode_alloc accepted null info pointers"); INFO ("+ Clearing th_info struct"); th_info_clear (&ti); return 0;}
开发者ID:Kivutar,项目名称:love-libretro,代码行数:24,
注:本文中的th_info_clear函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ th_info_init函数代码示例 C++ th_comment_clear函数代码示例 |