Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
65868602
Commit
65868602
authored
May 26, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'origin/1.0-bugfix'
parents
13a41fa0
aeb955d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
53 deletions
+71
-53
NEWS
NEWS
+1
-1
modules/video_output/snapshot.c
modules/video_output/snapshot.c
+41
-33
src/video_output/video_output.c
src/video_output/video_output.c
+3
-0
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+26
-19
No files found.
NEWS
View file @
65868602
...
...
@@ -5,7 +5,7 @@ Mac OS X Interface:
* Completely reworked user interface (based upon works from GSoC 2008)
Changes between 0.9.9a and 1.0.0-rc
1
:
Changes between 0.9.9a and 1.0.0-rc
2
:
------------------------------------
Important notes:
...
...
modules/video_output/snapshot.c
View file @
65868602
...
...
@@ -26,10 +26,10 @@
* keep a cache of low-res snapshots.
* The snapshot structure is defined in include/snapshot.h
* In order to access the current snapshot cache, object variables are used:
* snapshot-list-pointer : the pointer on the first element in the list
* snapshot-datasize : size of a snapshot
*
vout-
snapshot-list-pointer : the pointer on the first element in the list
*
vout-
snapshot-datasize : size of a snapshot
* (also available in snapshot_t->i_datasize)
* snapshot-cache-size : size of the cache list
*
vout-
snapshot-cache-size : size of the cache list
*
* It is used for the moment by the CORBA module and a specialized
* python-vlc binding.
...
...
@@ -84,10 +84,12 @@ vlc_module_begin ()
set_subcategory
(
SUBCAT_VIDEO_VOUT
)
set_capability
(
"video output"
,
1
)
add_integer
(
"snapshot-width"
,
320
,
NULL
,
WIDTH_TEXT
,
WIDTH_LONGTEXT
,
false
)
add_integer
(
"snapshot-height"
,
200
,
NULL
,
HEIGHT_TEXT
,
HEIGHT_LONGTEXT
,
false
)
add_string
(
"snapshot-chroma"
,
"RV32"
,
NULL
,
CHROMA_TEXT
,
CHROMA_LONGTEXT
,
true
)
add_integer
(
"snapshot-cache-size"
,
50
,
NULL
,
CACHE_TEXT
,
CACHE_LONGTEXT
,
true
)
add_integer
(
"vout-snapshot-width"
,
320
,
NULL
,
WIDTH_TEXT
,
WIDTH_LONGTEXT
,
false
)
add_integer
(
"vout-snapshot-height"
,
200
,
NULL
,
HEIGHT_TEXT
,
HEIGHT_LONGTEXT
,
false
)
add_string
(
"vout-snapshot-chroma"
,
"RV32"
,
NULL
,
CHROMA_TEXT
,
CHROMA_LONGTEXT
,
true
)
add_deprecated_alias
(
"snapshot-chroma"
)
add_integer
(
"vout-snapshot-cache-size"
,
50
,
NULL
,
CACHE_TEXT
,
CACHE_LONGTEXT
,
true
)
add_deprecated_alias
(
"snapshot-cache-size"
)
set_callbacks
(
Create
,
Destroy
)
vlc_module_end
()
...
...
@@ -128,11 +130,11 @@ static int Create( vlc_object_t *p_this )
if
(
!
p_vout
->
p_sys
)
return
VLC_ENOMEM
;
var_Create
(
p_vout
,
"snapshot-width"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"snapshot-height"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"snapshot-datasize"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"snapshot-cache-size"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"snapshot-list-pointer"
,
VLC_VAR_ADDRESS
);
var_Create
(
p_vout
,
"
vout-
snapshot-width"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"
vout-
snapshot-height"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"
vout-
snapshot-datasize"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"
vout-
snapshot-cache-size"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"
vout-
snapshot-list-pointer"
,
VLC_VAR_ADDRESS
);
p_vout
->
pf_init
=
Init
;
p_vout
->
pf_end
=
End
;
...
...
@@ -157,14 +159,20 @@ static int Init( vout_thread_t *p_vout )
int
i_height
;
int
i_datasize
;
i_width
=
config_GetInt
(
p_vout
,
"snapshot-width"
);
i_height
=
config_GetInt
(
p_vout
,
"snapshot-height"
);
i_width
=
config_GetInt
(
p_vout
,
"
vout-
snapshot-width"
);
i_height
=
config_GetInt
(
p_vout
,
"
vout-
snapshot-height"
);
psz_chroma
=
config_GetPsz
(
p_vout
,
"snapshot-chroma"
);
if
(
!
psz_chroma
)
psz_chroma
=
config_GetPsz
(
p_vout
,
"
vout-
snapshot-chroma"
);
if
(
psz_chroma
)
{
msg_Err
(
p_vout
,
"Cannot find chroma information."
);
return
VLC_EGENERIC
;
if
(
strlen
(
psz_chroma
)
<
4
)
{
msg_Err
(
p_vout
,
"vout-snapshot-chroma should be 4 characters long"
);
return
VLC_EGENERIC
;
}
i_chroma
=
VLC_FOURCC
(
psz_chroma
[
0
],
psz_chroma
[
1
],
psz_chroma
[
2
],
psz_chroma
[
3
]
);
free
(
psz_chroma
);
}
i_chroma
=
vlc_fourcc_GetCodecFromString
(
VIDEO_ES
,
psz_chroma
);
...
...
@@ -256,11 +264,11 @@ static int Init( vout_thread_t *p_vout )
p_vout
->
p_sys
->
i_datasize
=
i_datasize
;
p_vout
->
p_sys
->
i_index
=
0
;
p_vout
->
p_sys
->
i_size
=
config_GetInt
(
p_vout
,
"snapshot-cache-size"
);
p_vout
->
p_sys
->
i_size
=
config_GetInt
(
p_vout
,
"
vout-
snapshot-cache-size"
);
if
(
p_vout
->
p_sys
->
i_size
<
2
)
{
msg_Err
(
p_vout
,
"snapshot-cache-size must be at least 1."
);
msg_Err
(
p_vout
,
"
vout-
snapshot-cache-size must be at least 1."
);
return
VLC_EGENERIC
;
}
...
...
@@ -291,17 +299,17 @@ static int Init( vout_thread_t *p_vout )
}
val
.
i_int
=
i_width
;
var_Set
(
p_vout
,
"snapshot-width"
,
val
);
var_Set
(
p_vout
,
"
vout-
snapshot-width"
,
val
);
val
.
i_int
=
i_height
;
var_Set
(
p_vout
,
"snapshot-height"
,
val
);
var_Set
(
p_vout
,
"
vout-
snapshot-height"
,
val
);
val
.
i_int
=
i_datasize
;
var_Set
(
p_vout
,
"snapshot-datasize"
,
val
);
var_Set
(
p_vout
,
"
vout-
snapshot-datasize"
,
val
);
val
.
i_int
=
p_vout
->
p_sys
->
i_size
;
var_Set
(
p_vout
,
"snapshot-cache-size"
,
val
);
var_Set
(
p_vout
,
"
vout-
snapshot-cache-size"
,
val
);
val
.
p_address
=
p_vout
->
p_sys
->
p_list
;
var_Set
(
p_vout
,
"snapshot-list-pointer"
,
val
);
var_Set
(
p_vout
,
"
vout-
snapshot-list-pointer"
,
val
);
/* Get the p_input pointer (to access video times) */
p_vout
->
p_sys
->
p_input
=
vlc_object_find
(
p_vout
,
VLC_OBJECT_INPUT
,
...
...
@@ -310,9 +318,9 @@ static int Init( vout_thread_t *p_vout )
if
(
!
p_vout
->
p_sys
->
p_input
)
return
VLC_ENOOBJ
;
if
(
var_Create
(
p_vout
->
p_sys
->
p_input
,
"snapshot-id"
,
VLC_VAR_INTEGER
)
)
if
(
var_Create
(
p_vout
->
p_sys
->
p_input
,
"
vout-
snapshot-id"
,
VLC_VAR_INTEGER
)
)
{
msg_Err
(
p_vout
,
"Cannot create snapshot-id variable in p_input(%p)."
,
msg_Err
(
p_vout
,
"Cannot create
vout-
snapshot-id variable in p_input(%p)."
,
p_vout
->
p_sys
->
p_input
);
return
VLC_EGENERIC
;
}
...
...
@@ -320,9 +328,9 @@ static int Init( vout_thread_t *p_vout )
/* Register the snapshot vout module at the input level */
val
.
p_address
=
p_vout
;
if
(
var_Set
(
p_vout
->
p_sys
->
p_input
,
"snapshot-id"
,
val
)
)
if
(
var_Set
(
p_vout
->
p_sys
->
p_input
,
"
vout-
snapshot-id"
,
val
)
)
{
msg_Err
(
p_vout
,
"Cannot register snapshot-id in p_input(%p)."
,
msg_Err
(
p_vout
,
"Cannot register
vout-
snapshot-id in p_input(%p)."
,
p_vout
->
p_sys
->
p_input
);
return
VLC_EGENERIC
;
}
...
...
@@ -348,12 +356,12 @@ static void Destroy( vlc_object_t *p_this )
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
int
i_index
;
var_Destroy
(
p_vout
->
p_sys
->
p_input
,
"snapshot-id"
);
var_Destroy
(
p_vout
->
p_sys
->
p_input
,
"
vout-
snapshot-id"
);
vlc_object_release
(
p_vout
->
p_sys
->
p_input
);
var_Destroy
(
p_this
,
"snapshot-width"
);
var_Destroy
(
p_this
,
"snapshot-height"
);
var_Destroy
(
p_this
,
"snapshot-datasize"
);
var_Destroy
(
p_this
,
"
vout-
snapshot-width"
);
var_Destroy
(
p_this
,
"
vout-
snapshot-height"
);
var_Destroy
(
p_this
,
"
vout-
snapshot-datasize"
);
for
(
i_index
=
0
;
i_index
<
p_vout
->
p_sys
->
i_size
;
i_index
++
)
{
...
...
src/video_output/video_output.c
View file @
65868602
...
...
@@ -1202,6 +1202,9 @@ static void* RunThread( void *p_this )
picture_Copy
(
p_pic
,
p_directbuffer
);
p_pic
->
format
.
i_sar_num
=
p_vout
->
fmt_out
.
i_sar_num
;
p_pic
->
format
.
i_sar_den
=
p_vout
->
fmt_out
.
i_sar_den
;
p_pic
->
p_next
=
p_vout
->
p
->
snapshot
.
p_picture
;
p_vout
->
p
->
snapshot
.
p_picture
=
p_pic
;
p_vout
->
p
->
snapshot
.
i_request
--
;
...
...
src/video_output/vout_pictures.c
View file @
65868602
...
...
@@ -1001,30 +1001,37 @@ int picture_Export( vlc_object_t *p_obj,
fmt_out
.
i_sar_num
=
fmt_out
.
i_sar_den
=
1
;
fmt_out
.
i_chroma
=
i_format
;
fmt_out
.
i_width
=
i_override_width
;
fmt_out
.
i_height
=
i_override_height
;
if
(
fmt_out
.
i_height
==
0
&&
fmt_out
.
i_width
>
0
)
/* compute original width/height */
unsigned
int
i_original_width
;
unsigned
int
i_original_height
;
if
(
fmt_in
.
i_sar_num
>=
fmt_in
.
i_sar_den
)
{
fmt_out
.
i_height
=
fmt_in
.
i_height
*
fmt_out
.
i_width
/
fmt_in
.
i_width
;
const
int
i_height
=
fmt_out
.
i_height
*
fmt_in
.
i_sar_den
/
fmt_in
.
i_sar_num
;
if
(
i_height
>
0
)
fmt_out
.
i_height
=
i_height
;
i_original_width
=
fmt_in
.
i_width
*
fmt_in
.
i_sar_num
/
fmt_in
.
i_sar_den
;
i_original_height
=
fmt_in
.
i_height
;
}
else
{
if
(
fmt_out
.
i_width
==
0
&&
fmt_out
.
i_height
>
0
)
{
fmt_out
.
i_width
=
fmt_in
.
i_width
*
fmt_out
.
i_height
/
fmt_in
.
i_height
;
}
else
{
fmt_out
.
i_width
=
fmt_in
.
i_width
;
fmt_out
.
i_height
=
fmt_in
.
i_height
;
}
const
int
i_width
=
fmt_out
.
i_width
*
fmt_in
.
i_sar_num
/
fmt_in
.
i_sar_den
;
if
(
i_width
>
0
)
fmt_out
.
i_width
=
i_width
;
i_original_width
=
fmt_in
.
i_width
;
i_original_height
=
fmt_in
.
i_height
*
fmt_in
.
i_sar_den
/
fmt_in
.
i_sar_num
;
}
/* */
fmt_out
.
i_width
=
(
i_override_width
<
0
)
?
i_original_width
:
i_override_width
;
fmt_out
.
i_height
=
(
i_override_height
<
0
)
?
i_original_height
:
i_override_height
;
/* scale if only one direction is provided */
if
(
fmt_out
.
i_height
==
0
&&
fmt_out
.
i_width
>
0
)
{
fmt_out
.
i_height
=
fmt_in
.
i_height
*
fmt_out
.
i_width
*
fmt_in
.
i_sar_den
/
fmt_in
.
i_width
/
fmt_in
.
i_sar_num
;
}
else
if
(
fmt_out
.
i_width
==
0
&&
fmt_out
.
i_height
>
0
)
{
fmt_out
.
i_width
=
fmt_in
.
i_width
*
fmt_out
.
i_height
*
fmt_in
.
i_sar_num
/
fmt_in
.
i_height
/
fmt_in
.
i_sar_den
;
}
image_handler_t
*
p_image
=
image_HandlerCreate
(
p_obj
);
...
...
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