Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
118
Issues
118
List
Boards
Labels
Milestones
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
7fc90e44
Commit
7fc90e44
authored
Aug 06, 2012
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* #14402: video: put CIF first in list of resolutions
parent
ca8b3f23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
daemon/src/video/video_v4l2.cpp
daemon/src/video/video_v4l2.cpp
+20
-0
daemon/src/video/video_v4l2.h
daemon/src/video/video_v4l2.h
+1
-0
No files found.
daemon/src/video/video_v4l2.cpp
View file @
7fc90e44
...
...
@@ -30,6 +30,7 @@
#include <string>
#include <cstring> // for memset
#include <algorithm>
#include <vector>
#include <climits>
#include <stdexcept>
...
...
@@ -256,6 +257,24 @@ VideoV4l2Channel::getSizes(int fd, unsigned int pixelformat)
return
fmt
.
fmt
.
pix
.
pixelformat
;
}
namespace
{
bool
isCIF
(
const
VideoV4l2Size
&
size
)
{
const
unsigned
CIF_WIDTH
=
352
;
const
unsigned
CIF_HEIGHT
=
288
;
return
size
.
width
==
CIF_WIDTH
and
size
.
height
==
CIF_HEIGHT
;
}
}
// Put CIF resolution (352x288) first in the list since it is more prevalent in
// VoIP
void
VideoV4l2Channel
::
putCIFFirst
()
{
std
::
vector
<
VideoV4l2Size
>::
iterator
iter
=
std
::
find_if
(
sizes_
.
begin
(),
sizes_
.
end
(),
isCIF
);
if
(
iter
!=
sizes_
.
end
()
and
iter
!=
sizes_
.
begin
())
std
::
swap
(
*
iter
,
*
sizes_
.
begin
());
}
void
VideoV4l2Channel
::
getFormat
(
int
fd
)
{
if
(
ioctl
(
fd
,
VIDIOC_S_INPUT
,
&
idx
))
...
...
@@ -288,6 +307,7 @@ void VideoV4l2Channel::getFormat(int fd)
fmt
.
index
=
best_idx
;
pixelformat
=
getSizes
(
fd
,
pixelformat
);
putCIFFirst
();
setFourcc
(
pixelformat
);
}
...
...
daemon/src/video/video_v4l2.h
View file @
7fc90e44
...
...
@@ -84,6 +84,7 @@ class VideoV4l2Channel {
std
::
string
name
;
private:
void
putCIFFirst
();
std
::
vector
<
VideoV4l2Size
>
sizes_
;
char
fourcc_
[
5
];
};
...
...
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