-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathffplay_seek.drawio
96 lines (96 loc) · 13.7 KB
/
ffplay_seek.drawio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<mxfile host="65bd71144e">
<diagram id="DdG-y0ODtN2K0PK0t-bM" name="Page-1">
<mxGraphModel dx="562" dy="1143" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="4" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="2" target="3">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="2" value="<div style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; font-size: 10.8px; line-height: 16px;"><div style="color: rgb(204, 204, 204); font-size: 10.8px; line-height: 16px;"><span style="color: rgb(86, 156, 214);">static</span> <span style="color: rgb(86, 156, 214);">void</span> <span style="color: rgb(220, 220, 170);">event_loop</span>(<span style="color: rgb(78, 201, 176);">VideoState</span> <span style="color: rgb(212, 212, 212);">*</span><span style="color: rgb(156, 220, 254);">cur_stream</span>){</div><div style="color: rgb(204, 204, 204); font-size: 10.8px; line-height: 16px;">...</div><div style="color: rgb(204, 204, 204); font-size: 10.8px; line-height: 16px;">按下左右箭头或者PGUP,PGDWN后,设置seek增量incr(单位秒),转入do_seek逻辑</div><div style="color: rgb(204, 204, 204); font-size: 10.8px; line-height: 16px;">}</div></div>" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d80073;fontColor=#ffffff;strokeColor=#A50040;" vertex="1" parent="1">
<mxGeometry x="30" y="90" width="170" height="130" as="geometry"/>
</mxCell>
<mxCell id="6" style="edgeStyle=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="3" target="5">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="7" value="true" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="6">
<mxGeometry x="-0.1765" y="-1" relative="1" as="geometry">
<mxPoint x="1" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="9" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="3" target="8">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="11" value="false" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="9">
<mxGeometry x="0.1" y="4" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="3" value="<div style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; font-size: 10.8px; line-height: 16px;"><span style="color: rgb(197, 134, 192);">if</span> (<span style="color: rgb(156, 220, 254);">seek_by_bytes</span>)</div>" style="rhombus;whiteSpace=wrap;html=1;labelBackgroundColor=none;fillColor=#647687;fontColor=#ffffff;strokeColor=#314354;" vertex="1" parent="1">
<mxGeometry x="22.5" y="250" width="185" height="40" as="geometry"/>
</mxCell>
<mxCell id="12" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="5" target="10">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="5" value="根据incr的秒数,再乘以字节率(比特率 / 8),算出要偏移多少字节,这里传入stream_seek的pos和rel的单位是字节" style="rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;fillColor=#647687;fontColor=#ffffff;strokeColor=#314354;" vertex="1" parent="1">
<mxGeometry x="260" y="223.75" width="130" height="92.5" as="geometry"/>
</mxCell>
<mxCell id="15" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="8" target="14">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="8" value="计算seek到的目标时间,这里传入stream_seek的pos和rel的单位是微秒" style="rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;fillColor=#647687;fontColor=#ffffff;strokeColor=#314354;" vertex="1" parent="1">
<mxGeometry x="55" y="330" width="120" height="65" as="geometry"/>
</mxCell>
<mxCell id="18" style="edgeStyle=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="10" target="16">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="325" y="555"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="10" value="<div style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; font-size: 10.8px; line-height: 16px;"><span style="color: rgb(220, 220, 170);">stream_seek</span>(<span style="color: rgb(156, 220, 254);">cur_stream</span>, <span style="color: rgb(156, 220, 254);">pos</span>, <span style="color: rgb(156, 220, 254);">incr</span>, <span style="color: rgb(181, 206, 168);">1</span>)</div>" style="rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;fillColor=#647687;fontColor=#ffffff;strokeColor=#314354;" vertex="1" parent="1">
<mxGeometry x="247.5" y="425" width="155" height="60" as="geometry"/>
</mxCell>
<mxCell id="17" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="14" target="16">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="14" value="<span style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; font-size: 10.8px; color: rgb(220, 220, 170);">stream_seek</span><span style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; font-size: 10.8px; color: rgb(204, 204, 204);">(...,&nbsp;</span><font style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; font-size: 10.8px;" color="#b5cea8">0)</font>" style="rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;fillColor=#647687;fontColor=#ffffff;strokeColor=#314354;" vertex="1" parent="1">
<mxGeometry x="45" y="440" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="20" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;dashed=1;" edge="1" parent="1" source="16" target="19">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="16" value="设置is中执行seek操作所用的相关变量,并且设置is-&gt;seek_req,从而告知解复用线程执行seek逻辑" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fillColor=#76608a;fontColor=#ffffff;strokeColor=#432D57;" vertex="1" parent="1">
<mxGeometry x="42.5" y="510" width="145" height="90" as="geometry"/>
</mxCell>
<mxCell id="22" style="edgeStyle=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=11;" edge="1" parent="1" source="19" target="21">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="19" value="<font style="font-size: 11px;">解复用线程read_thread里面进入<span style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace;"> </span><span style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; color: rgb(197, 134, 192);">if</span><span style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace;"> (</span><span style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; color: rgb(156, 220, 254);">is</span><span style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace;">-&gt;</span><span style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; color: rgb(156, 220, 254);">seek_req</span><span style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace;">)</span></font><div style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; line-height: 16px; font-size: 11px;"><div style=""><font style="font-size: 11px;"> {...}逻辑</font></div></div>" style="rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="1">
<mxGeometry x="55" y="650" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="24" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;" edge="1" parent="1" source="21" target="23">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="21" value="<div style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; font-size: 10.8px; line-height: 16px;"><span style="color: rgb(156, 220, 254);">ret</span> <span style="color: rgb(212, 212, 212);">=</span> <span style="color: rgb(220, 220, 170);">avformat_seek_file(...)</span></div>" style="rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=11;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="1">
<mxGeometry x="220" y="660" width="170" height="40" as="geometry"/>
</mxCell>
<mxCell id="27" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;" edge="1" parent="1" source="23" target="26">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="23" value="<div style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; font-size: 10.8px; line-height: 16px;"><div style="font-size: 10.8px; line-height: 16px;"><span style="color: rgb(220, 220, 170);">packet_queue_flush(...)清除PacketQueue缓存</span></div></div>" style="rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=11;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="1">
<mxGeometry x="220" y="740" width="170" height="40" as="geometry"/>
</mxCell>
<mxCell id="29" style="edgeStyle=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;fontSize=11;" edge="1" parent="1" source="26" target="28">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="26" value="<div style="color: rgb(204, 204, 204); font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; font-size: 10.8px; line-height: 16px;"><div style="font-size: 10.8px; line-height: 16px;"><div style="font-size: 10.8px; line-height: 16px;"><span style="color: rgb(220, 220, 170);">set_clock</span>(<span style="color: rgb(212, 212, 212);">&amp;</span><span style="color: rgb(156, 220, 254);">is</span>-&gt;<span style="color: rgb(156, 220, 254);">extclk</span>, <span style="color: rgb(156, 220, 254);">seek_target</span> <span style="color: rgb(212, 212, 212);">/</span> (<span style="color: rgb(86, 156, 214);">double</span>)AV_TIME_BASE, <span style="color: rgb(181, 206, 168);">0</span>);</div></div></div>" style="rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=11;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="1">
<mxGeometry x="220" y="820" width="170" height="50" as="geometry"/>
</mxCell>
<mxCell id="28" value="清标志位,如果当前视频暂停,则从当前位置渲染一帧后暂停" style="rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=11;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="1">
<mxGeometry x="55" y="815" width="120" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>