Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
2c490172
Kaydet (Commit)
2c490172
authored
Ock 27, 1993
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
- Added LiveVideoOutSlow class (which only updates after full pkt)
- fixed bug in setmirror - cleaned up some common code
üst
34679b76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
14 deletions
+44
-14
LiveVideoOut.py
Demo/sgi/video/LiveVideoOut.py
+44
-14
No files found.
Demo/sgi/video/LiveVideoOut.py
Dosyayı görüntüle @
2c490172
...
...
@@ -51,6 +51,17 @@ class LiveVideoOut:
self
.
disp
.
setsize
(
vw
,
vh
)
self
.
reshapewindow
()
# Return the number of bytes in one video line
def
linewidth
(
self
):
if
self
.
disp
.
format
==
'mono'
:
return
(
self
.
vw
+
7
)
/
8
elif
self
.
disp
.
format
==
'grey2'
:
return
(
self
.
vw
+
3
)
/
4
elif
self
.
disp
.
format
==
'grey4'
:
return
(
self
.
vw
+
1
)
/
2
else
:
return
self
.
vw
# Call this to display the next video packet. Arguments:
# pos: line number where the packet begins
# data: image data of the packet
...
...
@@ -58,19 +69,10 @@ class LiveVideoOut:
# LiveVideoIn.getnextpacket()).
def
putnextpacket
(
self
,
pos
,
data
):
if
self
.
disp
.
format
==
'mono'
:
# Unfortunately size-check is difficult for
# packed video
nline
=
(
len
(
data
)
*
8
)
/
self
.
vw
elif
self
.
disp
.
format
==
'grey2'
:
nline
=
(
len
(
data
)
*
4
)
/
self
.
vw
elif
self
.
disp
.
format
==
'grey4'
:
nline
=
(
len
(
data
)
*
2
)
/
self
.
vw
else
:
nline
=
len
(
data
)
/
self
.
vw
if
nline
*
self
.
vw
<>
len
(
data
):
print
'Incorrect-sized video fragment ignored'
return
nline
=
len
(
data
)
/
self
.
linewidth
()
if
nline
*
self
.
linewidth
()
<>
len
(
data
):
print
'Incorrect-sized video fragment ignored'
return
oldwid
=
gl
.
winget
()
gl
.
winset
(
self
.
wid
)
self
.
disp
.
showpartframe
(
data
,
None
,
(
0
,
pos
,
self
.
vw
,
nline
))
...
...
@@ -92,4 +94,32 @@ class LiveVideoOut:
if
mirrored
:
xpf
=
-
xpf
info
=
(
f
,
w
,
h
,
(
xpf
,
ypf
),
c0
,
c1
,
c2
,
o
,
cp
)
self
.
disp
.
setinfo
(
inf0
)
self
.
disp
.
setinfo
(
info
)
self
.
disp
.
initcolormap
()
self
.
disp
.
clear
()
#
# This derived class has one difference with the base class: the video is
# not displayed until an entire image has been gotten
#
class
LiveVideoOutSlow
(
LiveVideoOut
):
# Reshapewindow - Realloc buffer.
# (is also called by init() indirectly)
def
reshapewindow
(
self
):
LiveVideoOut
.
reshapewindow
(
self
)
self
.
buffer
=
'
\0
'
*
self
.
linewidth
()
*
self
.
vh
self
.
isbuffered
=
[]
# putnextpacket - buffer incoming data until a complete
# image has been received
def
putnextpacket
(
self
,
pos
,
data
):
if
pos
in
self
.
isbuffered
or
pos
==
0
:
LiveVideoOut
.
putnextpacket
(
self
,
0
,
self
.
buffer
)
self
.
isbuffered
=
[]
self
.
isbuffered
.
append
(
pos
)
bpos
=
pos
*
self
.
linewidth
()
epos
=
bpos
+
len
(
data
)
self
.
buffer
=
self
.
buffer
[:
bpos
]
+
data
+
self
.
buffer
[
epos
:]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment