File: mpeg.rsd

package info (click to toggle)
ruby-sdl 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 1,544 kB
  • ctags: 1,359
  • sloc: cpp: 7,598; ansic: 4,498; ruby: 2,246; makefile: 106; sh: 102
file content (609 lines) | stat: -rw-r--r-- 7,615 bytes parent folder | download | duplicates (4)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
= MPEG playback
* ((<MPEG playback Outline>))
* ((<SDL::MPEG>))
* ((<SDL::MPEG::Info>))
* ((<MPEG playback methods>))
TOC

== MPEG playback Outline
Ruby/SDL enables you to play MPEG movie 
with ((<SMPEG|URL:http://www.icculus.org/smpeg>)).

Before calling MPEG methods, @[init] should be called 
with SDL::INIT_AUDIO|SDL::INIT_VIDEO and 
@[Mixer.open] should be called.

MPEG playback system runs in sub thread(native thread).
Therefore you cannot read and write movie @[Surface] 
while playing. In addition you cannot use @[Mixer] 
routines while playing if @[audio is enabled|MPEG#enable_audio].
Ruby/SDL doesn't control such an invalid access.

== SDL::MPEG
This class represents MPEG stream and playing state.

METHODS(MPEG)

== SDL::MPEG::Info
This class represents @[MPEG] information.
You can get instance by @[MPEG#info].

METHODS(MPEG::Info)

== MPEG playback methods
%%%
NAME new
MOD MPEG
TYPE .
DEP SMPEG
PURPOSE Load MPEG file.
RVAL SDL::MPEG

PROTO
new(filename)
load(filename)

DESC
Loads a $[filename] and returns 
new @[MPEG] object.

EXCEPTION *

SEEALSO
MPEG#info
MPEG#play

%%
NAME info
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Get information about MPEG object
RVAL SDL::MPEG::Info

PROTO
info

DESC
Gets information about $[self] as @[MPEG::Info] object.

SEEALSO
MPEG::Info

%%
NAME enable_audio
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Enable/Dislable audio

PROTO
enable_audio(enable)
enableAudio(enable)

DESC
Enables or disables audio.
If $[enable] is true, audio data is played, but if $[enable]
is false, audio data is not played.

NOTES
Audio enable/disable setting is reflected after
playing starts.

SEEALSO
MPEG#enable_video
MPEG#info

%%
NAME enable_video
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Enable/Disable video

PROTO
enable_video(enable)
enableVideo(enable)

DESC
Enables or disables audio.
If $[enable] is true, movie data is played, but if $[enable]
is false, movie data is not played.

SEEALSO
MPEG#enable_audio
MPEG#info

%%
NAME status
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Get current status
RVAL Integer

PROTO
status

DESC
Returns current status of $[self] as follows:
* SDL::MEPG::ERROR - system has some errors
* SDL::MPEG::STOPPED - movie is stopped
* SDL::MPEG::PLAYING - movie is playing

SEEALSO
MPEG#info

%%
NAME set_volume
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Change volume of MPEG stream

PROTO
set_volume(volume)
setVolume(volume)

DESC
Set volume MPEG stream from 0 to 100.

NOTES
You cannot get current volume.

SEEALSO
MPEG#enable_audio

%%
NAME set_display
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Set display surface

PROTO
set_display(surface)
setDisplay(surface)

DESC
Sets the @[surface|Surface] that the playing movie displays on.
Normally, the surface object returned by @[set_video_mode]
is used as $[surface].

NOTES
MPEG playback system call @[Screen#update_rect] from 
a (native) sub thread.

SEEALSO
Surface
MPEG#play

%%
NAME set_loop
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Set/Clear looping play

PROTO
set_loop(repeat)
setLoop(repeat)

DESC
Set or clear looping play on $[self].

SEEALSO
MPEG#play

%%
NAME scale_xy
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Scale pixel display

PROTO
scale_xy(width, height)
scaleXY(width, height)

DESC
Set scale pixel display on $[self].
The Unit of $[width] and $[height] is pixel.

SEEALSO
MPEG#scale
MPEG#set_display_region

%%
NAME scale
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Scale pixel display

PROTO
scale(scale)

DESC
Set scale display on $[self].

SEEALSO
MPEG#scale_xy

%%
NAME move
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Move the video display area

PROTO
move(x, y)

DESC
Moves the video display to ($[x], $[y]) 
within the destination surface set by @[MPEG#set_display].

SEEALSO
MPEG#set_display
MPEG#set_display_region

%%
NAME set_display_region
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Set the video display region

PROTO
set_display_region(x, y, w, h)

DESC
Set the region of the video to be shown at 
the rectangle of $[x], $[y], $[w], $[h]

SEEALSO
MPEG#move
MPEG#scale_xy

%%
NAME play
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Play an MPEG object

PROTO
play

DESC
Plays an MPEG object.


NOTES
You don't have to access surface set by @[MPEG#set_display].
x
SEEALSO
MPEG#pause
MPEG#stop
MPEG#rewind
MPEG#seek
MPEG#skip
MPEG#render_frame

%%
NAME stop
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Stop playback of an MPEG object

PROTO
stop

DESC
Stop play back of $[self].

SEEALSO
MPEG#play

%%
NAME pause
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Pause/Resume playback of an MPEG object

PROTO
pause

DESC
Pauses/Resumes playback of $[self].
Pauses playback if $[self] is playing, and
Resume playback if paused.

%%
NAME rewind
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Rewind the play position 

PROTO
rewind

DESC
Rewinds the play position of $[self]
to the beginning of the MPEG.


%%
NAME seek
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Seek in the MPEG stream.

PROTO
seek(bytes)

DESC
Seeks $[bytes] ((*bytes*)) the play position of $[self].

SEEALSO
MPEG#play
MPEG#skip

%%
NAME skip
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Skip seconds in the MPEG stream

PROTO
skip(seconds)

DESC
Skips $[seconds] seconds in $[self] MPEG stream.
$[seconds] can be Float or Integer.

SEEALSO
MPEG#play
MPEG#seek

%%
NAME render_frame
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Render a particular frame in the MPEG video.

PROTO
render_frame(framenum)

DESC
Render the $[framenum]-th frame in the surface set by
@[MEPG#set_display].

SEEALSO
MPEG#render_final
MPEG#play

%%
NAME render_final
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Render the last frame of an MPEG video

PROTO
render_final(dst, x, y)

DESC
Render the last frame of $[self] video 
at ($[x], $[y]) in the $[dst] @[surface|Surface].

%%
NAME set_filer
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE Set video filter

PROTO
set_filer(filter)

DESC
Selects video filter from one of following:
* SDL::MPEG::NULL_FILTER no filter
* SDL::MPEG::BILIEAR_FILTER bilinear filter
* SDL::MPEG::DEBLOCKING_FILTER deblocking filter

%%
NAME has_audio
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE Get whether an MPEG stream has audio data
RVAL true/false

PROTO
has_audio

DESC
Returns true if $[self] MPEG stream has audio data,
otherwise returns false.

%%
NAME has_video
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE Get whether an MPEG stream has video data
RVAL true/false

PROTO
has_video

DESC
Returns true if $[self] MPEG stream has video data,
otherwise returns false.

%%
NAME width
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE Get width of video

PROTO
width

DESC
Returns the width of video as pixels.


%%
NAME height
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE Get height of video

PROTO
height

DESC
Returns the width of video as pixels.

%%
NAME current_frame
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE

PROTO
current_frame

DESC
not documented yet

%%
NAME current_fps
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE

PROTO
current_fps

DESC
not documented yet

%%
NAME audio_string
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE

PROTO
audio_string

DESC
not documented yet

%%
NAME audio_current_frame
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE

PROTO
audio_current_frame

DESC
not documented yet

%%
NAME current_offset
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE

PROTO
current_offset

DESC
not documented yet

%%
NAME total_size
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE

PROTO
total_size

DESC
not documented yet

%%
NAME current_time
MOD MPEG::Info
TYPE #
DEP SMPEG
PURPOSE

PROTO
current_time

DESC
not documented yet

%%
NAME total_time
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE

PROTO
total_time

DESC
not documented yet

%%
NAME delete
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE

PROTO
delete

DESC
not documented yet

%%
NAME deleted?
MOD MPEG
TYPE #
DEP SMPEG
PURPOSE

PROTO
deleted?

DESC
not documented yet