forked from WebPlatformForEmbedded/WPEWebKit
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ONEM-38082: Redesigned telemetry module
- Loading branch information
1 parent
afa6c7d
commit 456aa86
Showing
17 changed files
with
406 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Source/ThirdParty/telemetry/include/DummyTelemetryReport.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
#include "ITelemetry.h" | ||
|
||
namespace Telemetry { | ||
|
||
class DummyTelemetryReport: public IReport { | ||
|
||
public: | ||
void reportPlaybackState( | ||
AVPipelineState state, | ||
const std::string &additionalInfo = "", | ||
MediaType mediaType = MediaType::NONE) override; | ||
void reportDrmInfo( | ||
DrmType drmType, | ||
const std::string &additionalInfo = "") override; | ||
void reportWaylandInfo( | ||
const IWaylandInfoGetter &getter, | ||
WaylandAction action, | ||
WaylandGraphicsState gfxState, | ||
WaylandInputsState inputsState) override; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace Telemetry { | ||
|
||
/* | ||
* Helper function to get some telemetry data from Wayland. | ||
*/ | ||
class IWaylandInfoGetter { | ||
public: | ||
/* | ||
* Don't include: | ||
* #include <EGL/egl.h> | ||
* #include <EGL/eglplatform.h> | ||
* since there are import order issues. | ||
* Defining needed types as void*, like WebKit does. | ||
*/ | ||
typedef void *EGLConfig; | ||
typedef void *EGLContext; | ||
typedef void *EGLDisplay; | ||
typedef void *EGLSurface; | ||
|
||
virtual EGLDisplay getEGLDisplay() const = 0; | ||
virtual EGLConfig getEGLConfig() const = 0; | ||
virtual EGLSurface getEGLSurface() const = 0; | ||
virtual EGLContext getEGLContext() const = 0; | ||
virtual unsigned int getWindowWidth() const = 0; | ||
virtual unsigned int getWindowHeight() const = 0; | ||
}; | ||
|
||
class IReport | ||
{ | ||
public: | ||
enum class AVPipelineState { | ||
CREATE, | ||
PLAY, | ||
PAUSE, | ||
STOP, | ||
DESTROY, | ||
FIRST_FRAME_DECODED, | ||
END_OF_STREAM, | ||
DECRYPT_ERROR, | ||
PLAYBACK_ERROR, | ||
DRM_ERROR, | ||
ERROR, | ||
SEEK_START, | ||
SEEK_DONE, | ||
VIDEO_RESOLUTION_CHANGED, | ||
UNKNOWN | ||
}; | ||
|
||
enum class MediaType { | ||
AUDIO, | ||
VIDEO, | ||
NONE | ||
}; | ||
|
||
enum class DrmType { | ||
PLAYREADY, | ||
WIDEVINE, | ||
NONE, | ||
UNKNOWN | ||
}; | ||
|
||
enum class WaylandAction | ||
{ | ||
INIT_GFX, | ||
DEINIT_GFX, | ||
INIT_INPUTS, | ||
DEINIT_INPUTS | ||
}; | ||
|
||
enum class WaylandGraphicsState | ||
{ | ||
GFX_NOT_INITIALIZED, | ||
GFX_INITIALIZED | ||
}; | ||
|
||
enum class WaylandInputsState | ||
{ | ||
INPUTS_NOT_INITIALIZED, | ||
INPUTS_INITIALIZED | ||
}; | ||
|
||
virtual ~IReport() = default; | ||
virtual void reportPlaybackState( | ||
AVPipelineState state, | ||
const std::string &additionalInfo, | ||
MediaType mediaType) = 0; | ||
virtual void reportDrmInfo( | ||
DrmType drmType, | ||
const std::string &additionalInfo) = 0; | ||
virtual void reportWaylandInfo( | ||
const IWaylandInfoGetter &getter, | ||
WaylandAction action, | ||
WaylandGraphicsState gfxState, | ||
WaylandInputsState inputsState) = 0; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include "ITelemetry.h" | ||
|
||
namespace Telemetry { | ||
|
||
class RdkTelemetryReport: public IReport { | ||
|
||
public: | ||
void reportPlaybackState( | ||
AVPipelineState state, | ||
const std::string &additionalInfo = "", | ||
MediaType mediaType = MediaType::NONE) override; | ||
void reportDrmInfo( | ||
DrmType drmType, | ||
const std::string &additionalInfo = "") override; | ||
void reportWaylandInfo( | ||
const IWaylandInfoGetter &getter, | ||
WaylandAction action, | ||
WaylandGraphicsState gfxState, | ||
WaylandInputsState inputsState) override; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include <stdarg.h> | ||
#include <string> | ||
|
||
#if defined(RDK_TELEMETRY) | ||
#include "RdkTelemetryReport.h" | ||
using TelemetryImpl = Telemetry::RdkTelemetryReport; | ||
#else | ||
#error "dupa!" | ||
#include "DummyTelemetryReport.h" | ||
using TelemetryImpl = Telemetry::DummyTelemetryReport; | ||
#endif | ||
|
||
namespace Telemetry | ||
{ | ||
void init(const std::string &name = "WebKitBrowser"); | ||
void deinit(); | ||
void reportErrorV(const char* file, int line, const char* function, const char* format, va_list args); | ||
void reportError(const char* file, int line, const char* function, const char* format, ...); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include "TelemetryReport.h" | ||
|
||
namespace Telemetry { | ||
|
||
void init(const std::string &name) { | ||
(void)name; | ||
} | ||
|
||
void deinit() { | ||
} | ||
|
||
void reportErrorV(const char* file, int line, const char* function, const char* format, va_list args) { | ||
(void)file; | ||
(void)line; | ||
(void)function; | ||
(void)format; | ||
(void)args; | ||
} | ||
|
||
void reportError(const char* file, int line, const char* function, const char* format, ...) { | ||
(void)file; | ||
(void)line; | ||
(void)function; | ||
(void)format; | ||
} | ||
|
||
void DummyTelemetryReport::reportPlaybackState( | ||
AVPipelineState state, | ||
const std::string &additionalInfo, | ||
MediaType mediaType) { | ||
(void)state; | ||
(void)additionalInfo; | ||
(void)mediaType; | ||
} | ||
|
||
void DummyTelemetryReport::reportDrmInfo( | ||
DrmType drmType, | ||
const std::string &additionalInfo) { | ||
(void)drmType; | ||
(void)additionalInfo; | ||
} | ||
|
||
void DummyTelemetryReport::reportWaylandInfo( | ||
const IWaylandInfoGetter &getter, | ||
WaylandAction action, | ||
WaylandGraphicsState gfxState, | ||
WaylandInputsState inputsState) { | ||
(void)getter; | ||
(void)action; | ||
(void)gfxState; | ||
(void)inputsState; | ||
} | ||
} |
Oops, something went wrong.