Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
02c89ddd
Commit
02c89ddd
authored
12 years ago
by
Emmanuel Lepage Vallee
Browse files
Options
Downloads
Patches
Plain Diff
[ #13265 ] Merge resolution and qsize into one class, deduplicate the code
parent
482beac5
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/videodevice.h
+8
-15
8 additions, 15 deletions
src/videodevice.h
src/videorenderer.cpp
+3
-3
3 additions, 3 deletions
src/videorenderer.cpp
with
11 additions
and
18 deletions
src/videodevice.h
+
8
−
15
View file @
02c89ddd
...
...
@@ -31,28 +31,21 @@ typedef QString VideoChannel;
typedef
QString
VideoRate
;
///@struct Resolution Equivalent of "640x480"
struct
LIB_EXPORT
Resolution
{
class
LIB_EXPORT
Resolution
:
public
QSize
{
public:
//Constructor
explicit
Resolution
(
uint
_width
,
uint
_height
)
:
width
(
_width
),
height
(
_height
){}
explicit
Resolution
(
uint
_width
,
uint
_height
)
:
QSize
(
_width
,
_height
){}
Resolution
(
QString
size
)
{
if
(
size
.
split
(
"x"
).
size
()
==
2
)
{
w
idth
=
size
.
split
(
"x"
)[
0
].
toInt
();
h
eight
=
size
.
split
(
"x"
)[
1
].
toInt
();
setW
idth
(
size
.
split
(
"x"
)[
0
].
toInt
()
)
;
setH
eight
(
size
.
split
(
"x"
)[
1
].
toInt
()
)
;
}
}
Resolution
(
const
Resolution
&
res
)
:
width
(
res
.
width
),
height
(
res
.
height
){}
Resolution
(
const
QSize
&
size
)
:
width
(
size
.
width
()),
height
(
size
.
height
()
){}
Resolution
(
const
Resolution
&
res
)
:
QSize
(
res
.
width
(
),
res
.
height
()
){}
Resolution
(
const
QSize
&
size
)
:
QSize
(
size
){}
//Getter
const
QString
toString
()
const
{
return
QString
::
number
(
width
)
+
"x"
+
QString
::
number
(
height
);}
//Attributes
uint
width
;
uint
height
;
const
QString
toString
()
const
{
return
QString
::
number
(
width
())
+
"x"
+
QString
::
number
(
height
());}
//Operator
bool
operator
==
(
const
Resolution
&
other
)
{
return
(
other
.
width
==
width
&&
other
.
height
==
height
);
}
};
///VideoDevice: V4L devices used to record video for video call
...
...
This diff is collapsed.
Click to expand it.
src/videorenderer.cpp
+
3
−
3
View file @
02c89ddd
...
...
@@ -47,8 +47,8 @@ VideoRenderer::VideoRenderer(QString shmPath, Resolution res): QObject(0),
m_isRendering
(
false
),
m_pTimer
(
nullptr
),
m_Res
(
res
)
{
m_ShmPath
=
shmPath
;
m_Width
=
res
.
width
;
m_Height
=
res
.
height
;
m_Width
=
res
.
width
()
;
m_Height
=
res
.
height
()
;
}
///Destructor
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment