Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
711d1c66
Commit
711d1c66
authored
Jun 14, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/call/CallModel): add a `cameraFirstFrameReceived`
parent
5c564b1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
4 deletions
+43
-4
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+11
-0
CallModel.hpp
linphone-desktop/src/components/call/CallModel.hpp
+6
-0
Camera.cpp
linphone-desktop/src/components/camera/Camera.cpp
+24
-1
Camera.hpp
linphone-desktop/src/components/camera/Camera.hpp
+2
-3
No files found.
linphone-desktop/src/components/call/CallModel.cpp
View file @
711d1c66
...
...
@@ -104,6 +104,15 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
// -----------------------------------------------------------------------------
void
CallModel
::
notifyCameraFirstFrameReceived
(
unsigned
int
width
,
unsigned
int
height
)
{
if
(
mNotifyCameraFirstFrameReceived
)
{
mNotifyCameraFirstFrameReceived
=
false
;
emit
cameraFirstFrameReceived
(
width
,
height
);
}
}
// -----------------------------------------------------------------------------
void
CallModel
::
accept
()
{
stopAutoAnswerTimer
();
...
...
@@ -231,10 +240,12 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
break
;
case
linphone
:
:
CallStatePausedByRemote
:
mNotifyCameraFirstFrameReceived
=
true
;
mPausedByRemote
=
true
;
break
;
case
linphone
:
:
CallStatePausing
:
mNotifyCameraFirstFrameReceived
=
true
;
mPausedByUser
=
true
;
break
;
...
...
linphone-desktop/src/components/call/CallModel.hpp
View file @
711d1c66
...
...
@@ -98,6 +98,8 @@ public:
static
void
setRecordFile
(
std
::
shared_ptr
<
linphone
::
CallParams
>
&
callParams
);
void
updateStats
(
const
std
::
shared_ptr
<
const
linphone
::
CallStats
>
&
callStats
);
void
notifyCameraFirstFrameReceived
(
unsigned
int
width
,
unsigned
int
height
);
Q_INVOKABLE
void
accept
();
Q_INVOKABLE
void
acceptWithVideo
();
Q_INVOKABLE
void
terminate
();
...
...
@@ -127,6 +129,8 @@ signals:
void
videoRequested
();
void
securityUpdated
();
void
cameraFirstFrameReceived
(
unsigned
int
width
,
unsigned
int
height
);
private:
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
...
...
@@ -183,6 +187,8 @@ private:
bool
mPausedByUser
=
false
;
bool
mRecording
=
false
;
bool
mNotifyCameraFirstFrameReceived
=
true
;
QString
mCallError
;
QVariantList
mAudioStats
;
...
...
linphone-desktop/src/components/camera/Camera.cpp
View file @
711d1c66
...
...
@@ -104,8 +104,11 @@ void CameraRenderer::render () {
if
(
mIsPreview
)
coreManager
->
getCore
()
->
previewOglRender
();
else
if
(
mCall
)
else
if
(
mCall
)
{
mCall
->
oglRender
();
if
(
mNotifyReceivedVideoSize
&&
notifyReceivedVideoSize
())
mNotifyReceivedVideoSize
=
false
;
}
msFunctions
->
bind
(
nullptr
);
coreManager
->
unlockVideoRender
();
...
...
@@ -148,6 +151,26 @@ void CameraRenderer::updateWindowId () {
mCall
->
setNativeVideoWindowId
(
mContextInfo
);
}
bool
CameraRenderer
::
notifyReceivedVideoSize
()
const
{
shared_ptr
<
const
linphone
::
VideoDefinition
>
videoDefinition
=
mCall
->
getCurrentParams
()
->
getReceivedVideoDefinition
();
unsigned
int
width
=
videoDefinition
->
getWidth
();
unsigned
int
height
=
videoDefinition
->
getHeight
();
if
(
width
&&
height
)
{
qInfo
()
<<
"Thread"
<<
QThread
::
currentThread
()
<<
QStringLiteral
(
"Received video size (width: %1, height: %2):"
)
.
arg
(
width
).
arg
(
height
)
<<
mContextInfo
;
CallModel
*
callModel
=
&
mCall
->
getData
<
CallModel
>
(
"call-model"
);
QTimer
::
singleShot
(
0
,
callModel
,
[
callModel
,
width
,
height
]
{
callModel
->
notifyCameraFirstFrameReceived
(
width
,
height
);
});
return
true
;
}
return
false
;
}
// -----------------------------------------------------------------------------
Camera
::
Camera
(
QQuickItem
*
parent
)
:
QQuickFramebufferObject
(
parent
)
{
...
...
linphone-desktop/src/components/camera/Camera.hpp
View file @
711d1c66
...
...
@@ -31,7 +31,6 @@
// =============================================================================
class
CallModel
;
class
Camera
;
struct
ContextInfo
;
namespace
linphone
{
...
...
@@ -39,8 +38,6 @@ namespace linphone {
}
class
CameraRenderer
:
public
QQuickFramebufferObject
::
Renderer
{
friend
class
Camera
;
public:
CameraRenderer
();
~
CameraRenderer
();
...
...
@@ -52,10 +49,12 @@ protected:
private:
void
updateWindowId
();
bool
notifyReceivedVideoSize
()
const
;
ContextInfo
*
mContextInfo
;
bool
mUpdateContextInfo
=
false
;
bool
mNotifyReceivedVideoSize
=
true
;
bool
mIsPreview
=
false
;
std
::
shared_ptr
<
linphone
::
Call
>
mCall
;
...
...
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