1. 程式人生 > >vlc從接收到資料流到播放視訊的過程分析

vlc從接收到資料流到播放視訊的過程分析

    VLC API documentation  或者VLC developer documentation
  
Chapter 5.  The video output layer 
Data structures and main loop 
Important data structures are defined in include/video.h and include/video_output.h. The main data structure is picture_t, which describes everything a video decoder thread needs. Please refer to this file for more information. Typically, p_data will be a pointer to YUV planar picture. 
Note also the subpicture_t structure. In fact the VLC SPU decoder only parses the SPU header, and converts the SPU graphical data to an internal format which can be rendered much faster. So a part of the "real" SPU decoder lies in src/video_output/video_spu.c. 
The vout_thread_t structure is much more complex, but you needn't understand everything. Basically the video output thread manages a heap of pictures and subpictures (5 by default). Every picture has a status (displayed, destroyed, empty...) and eventually a presentation time. The main job of the video output is an infinite loop to : [this is subject to change in the near future] 
Find the next picture to display in the heap. 
Find the current subpicture to display. 
Render the picture (if the video output plug-in doesn't support YUV overlay). Rendering will call an optimized YUV plug-in, which will also do the scaling, add subtitles and an optional picture information field. 
Sleep until the specified date. 
Display the picture (plug-in function). For outputs which display RGB data, it is often accomplished with a buffer switching. p_vout->p_buffer is an array of two buffers where the YUV transform takes place, and p_vout->i_buffer_index indicates the currently displayed buffer. 
Manage events. 
Methods used by video decoders 
The video output exports a bunch of functions so that decoders can send their decoded data. The most important function is vout_CreatePicture which allocates the picture buffer to the size indicated by the video decoder. It then just needs to feed (void *) p_picture->p_data with the decoded data, and call vout_DisplayPicture and vout_DatePicture upon necessary. 
picture_t * vout_CreatePicture ( vout_thread_t *p_vout, int i_type, int i_width, int i_height ) : Returns an allocated picture buffer. i_type will be for instance YUV_420_PICTURE, and i_width and i_height are in pixels. 
Warning
If no picture is available in the heap, vout_CreatePicture will return NULL. 
vout_LinkPicture ( vout_thread_t *p_vout, picture_t *p_pic ) : Increases the refcount of the picture, so that it doesn't get accidently freed while the decoder still needs it. For instance, an I or P picture can still be needed after displaying to decode interleaved B pictures. 
vout_UnlinkPicture ( vout_thread_t *p_vout, picture_t *p_pic ) : Decreases the refcount of the picture. An unlink must be done for every link previously made. 
vout_DatePicture ( vout_thread_t *p_vout, picture_t *p_pic ) : Gives the picture a presentation date. You can start working on a picture before knowing precisely at what time it will be displayed. For instance to date an I or P picture, you must wait until you have decoded all previous B pictures (which are indeed placed after - decoding order != presentation order). 
vout_DisplayPicture ( vout_thread_t *p_vout, picture_t *p_pic ) : Tells the video output that a picture has been completely decoded and is ready to be rendered. It can be called before or after vout_DatePicture. 
vout_DestroyPicture ( vout_thread_t *p_vout, picture_t *p_pic ) : Marks the picture as empty (useful in case of a stream parsing error). 
subpicture_t * vout_CreateSubPicture ( vout_thread_t *p_vout, int i_channel, int i_type ) : Returns an allocated subpicture buffer. i_channel is the ID of the subpicture channel, i_type is DVD_SUBPICTURE or TEXT_SUBPICTURE, i_size is the length in bytes of the packet. 
vout_DisplaySubPicture ( vout_thread_t *p_vout, subpicture_t *p_subpic ) : Tells the video output that a subpicture has been completely decoded. It obsoletes the previous subpicture. 
vout_DestroySubPicture ( vout_thread_t *p_vout, subpicture_t *p_subpic ) : Marks the subpicture as empty.

相關推薦

vlc接收資料播放視訊過程分析

    VLC API documentation  或者VLC developer documentation    Chapter 5.  The video output layer  Data structures and main loop  Important data structures ar

嵌入式 vlc接收資料播放視訊過程分析

Vlc流播放流程  vlc原始碼目錄樹: 目錄名稱 說明 bindings Java, CIL 和Python繫結 doc 幫助文件 (不是更新的) extras 另敘。 include VLC 標頭檔案 libs SRTP庫和

VLC -- 使用VLC播放視訊

VLC -- VLC串流播放視訊方式 開啟VLC後,在"媒體"選單選擇"流"選項,並新增一個即將要串流的視訊檔案: 然後點選串流按鈕,進入如下頁面: 該頁面顯示了一些基本資訊,繼續進行下一步: 在此頁面,我們可以設定需要的串流協議,並設定要串流到的目的地址:在

前端接收資料實現圖片預覽效果--ajax 請求二進位制 圖片 檔案 XMLHttpRequest 請求並處理二進位制資料 之最佳實踐

本文為轉載文章 原文連結:https://www.cnblogs.com/cdemo/p/5225848.html 首先要謝謝這位大神的無私貢獻!解決了我的問題也完美表達了我當時的心路歷程 ajax 請求二進位制流 圖片 檔案 XMLHttpRequest 請求並處理二進位制流資料 之最佳實踐

iOS PCM本地檔案,資料播放

最近做語音對講功能,查找了不少資料,現就音訊pcm檔案播放這一塊整理出來,以便檢視。 期間參考的文章有些已經找不著出處了,只把能找到的記錄一下,感謝分享! iOS語音對講(三)FFmpeg實時解碼AAC並播放PCM iOS播放PCM,NSData流程式碼(Audio Queue Serv

com.microsoft.sqlserver.jdbc.SQLServerException: 傳入的表格格式資料(TDS)遠端過程呼叫(RPC)協議不正確。此 RPC 請求中提供了過多的引數。

sqlserver在做批量插入的時候出現這個錯誤: com.microsoft.sqlserver.jdbc.SQLServerException: 傳入的表格格式資料流(TDS)遠端過程呼叫(RPC)協議流不正確。此 RPC 請求中提供了過多的引數。最多應為 2100。

使用php://input接收資料(還有多個引數的解決辦法)

最近的工作中接觸到一個手機上傳圖片到伺服器的小程式,剛開始一直在想該用怎樣的方式去接收資料,最後在網上看到大家都用php://input來接收。就去查了下php://input的官方介紹,確實可以,除了在enctype="multipart/form-data"情況下,是

奇怪的資料插入異常:傳入的表格格式資料(TDS)遠端過程呼叫(RPC)協議不正確。

前天完成了手頭的工作後,經理交給我一個bug讓我看下,我接過後看了下Bug資訊,是從未見過的異常,但根據異常資訊提示又很容易判斷出異常原因。 異常資訊:傳入的表格格式資料流(TDS)遠端過程呼叫(RPC)協議流不正確。引數 7 ("@ExchangeRate"): 提供的值不

IJKPlayer使用MediaCodec解碼和渲染視訊過程分析

IJKMediaCodec 解碼分析 1.func_run_sync(IJKFF_Pipenode *node) /ffpipenode_android_mediacodec_vdec.c —-drain_output_buffer(env,

Android6.0 WebView播放視訊原始碼分析

        最近因為專案的需要研究一下WebView播放視訊的呼叫過程。同時也對研究問題的方法有了新的認識,研究問題應該先有自己的研究主題,應該從易到難,由表及裡(好像初中、還是高中政治中說過這個,最近才明白,哈哈),不能違背這個定律,要不然自己會越研究越糊塗,也會很有

vlc學習計劃(7)--接收資料播放視訊過程分析

從接收到資料流到播放視訊的過程分析   從網路接收到流->對資料流進行視訊和音訊分離->對視訊用解碼器解碼->顯示解碼後的視訊流<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:off

精簡的FFMPEGUDP廣播接收視訊資料播放的示例

FIFO佇列緩衝區,用於接收從UDP獲得的視訊資料: CLinkedQueue.h #pragma once #include "stdafx.h" #include "afxsock.h" class CLinkedQueue { public: CLinkedQueu

使用VLC接收RTP並時時播放(RTP是pcma包)

簡單的 了解 不想 sdn 英文 好好學習 是不是 網絡數 ram 寫在前:   或許是本人水平有限, 一個簡單的問題楞是想了很久還沒想出來, 最後還是問我師父的結果.   總的來說, 目的就是: 服務器會發給本地電腦一系列的rtp包, 這些rtp包都是pcma編碼的語音包

video遠端獲取資料跳轉新頁面開始播放視訊

效果: 獲取電影資料每行3個 video.html <div id="item-video-animation" class="mui-control-content"> <div id="videoAnimation" style="text-align: cen

各種RTMP直播播放許可權_音視訊_資料花屏_問題檢測與分析工具EasyRTMPClient

之前的一篇部落格《網路攝像機IPCamera RTSP直播播放網路/許可權/音視訊資料/花屏問題檢測與分析助手EasyRTSPClient》,我們介紹了RTSP流的檢測和分析工具EasyRTSPClient,可以說已經是深入了我的平時運維工作中了,當我們發現有任

零實現簡易播放器:4.ffmpeg 解碼視訊為yuv資料-使用avcodec_send_packet與avcodec_receive_frame

ffmpeg 解碼視訊為yuv資料 作者:史正 郵箱:[email protected] 如有錯誤還請及時指正 如果有錯誤的描述給您帶來不便還請見諒 如需交流請傳送郵件,歡迎聯絡 csdn : https://blog.csdn.net/shizheng163 g

VLC播放攝像頭或者網路攝像頭通過rtsp讀取視訊

#include <stdio.h>   #include <stdint.h>   #include <math.h>   #include <stdlib.h>   #include <assert.h>  

使用live555 VLC傳送接收視訊TS

從中可以看出,對於轉碼的需求,也僅僅是添加了藍色的一段options而已--sout "#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:duplicate{dst=display,dst=standard{mux=ts{pid-vid

使用位元組複製檔案過程中容易導致複製的檔案無法使用(如MP3檔案比原來大了一千多倍且音樂無法播放)很嚴重的一個bug

使用BufferedInputStream和BufferedOutputStream複製檔案,相信大家都已經遊刃有餘了,但是有一個 很嚴重的bug不容小覷,如以下程式碼: package com.yeshide_02; import java.io.BufferedInputStream;

資料角度管窺 Moya 的實現(一):構建請求

相信大家都封裝過網路層。 雖然系統提供的網路庫以及一些著名的第三方網路庫(AFNetworking, Alamofire)已經能滿足各種 HTTP/HTTPS的網路請求,但直接在程式碼裡用起來,終歸是比較晦澀,不是那麼的順手。所以我們都會傾向於根據自己的實際需求,再封裝