[CI20] Refactor contrib/creator for Cobalt 16.154703
Refactoring is based on starboard/linux
Change-Id: I6903887fcd44c4aa2e8b41661e725d14989a9b52
diff --git a/src/starboard/contrib/creator/ci20x11/egl_workaround.cc b/src/starboard/contrib/creator/ci20x11/egl_workaround.cc
index e6f83e2..f812d71 100644
--- a/src/starboard/contrib/creator/ci20x11/egl_workaround.cc
+++ b/src/starboard/contrib/creator/ci20x11/egl_workaround.cc
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#include <X11/Xlib.h>
#include "cobalt/renderer/backend/egl/display.h"
extern "C" EGLDisplay __real_eglGetDisplay(EGLNativeDisplayType native_display);
@@ -20,7 +21,7 @@
extern "C" EGLBoolean __real_eglTerminate(EGLDisplay display);
extern "C" EGLBoolean __wrap_eglTerminate(EGLDisplay display);
-NativeDisplayType native_display_;
+Display* native_display_;
extern "C" EGLDisplay
__wrap_eglGetDisplay(EGLNativeDisplayType native_display) {
@@ -30,6 +31,6 @@
extern "C" EGLBoolean __wrap_eglTerminate(EGLDisplay display) {
EGLBoolean result = __real_eglTerminate(display);
- XCloseDisplay((NativeDisplayType) native_display_);
+ XCloseDisplay(native_display_);
return result;
}
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/4.9/compiler_flags.gypi b/src/starboard/contrib/creator/ci20x11/gcc/4.9/compiler_flags.gypi
index b782944..864c7ec 100644
--- a/src/starboard/contrib/creator/ci20x11/gcc/4.9/compiler_flags.gypi
+++ b/src/starboard/contrib/creator/ci20x11/gcc/4.9/compiler_flags.gypi
@@ -92,6 +92,11 @@
},
'target_defaults': {
+ 'defines': [
+ # By default, <EGL/eglplatform.h> pulls in some X11 headers that have some
+ # nasty macros (|Status|, for example) that conflict with Chromium base.
+ 'MESA_EGL_NO_X11_HEADERS'
+ ],
'cflags_c': [
# Limit to C99. This allows Linux to be a canary build for any
# C11 features that are not supported on some platforms' compilers.
diff --git a/src/starboard/contrib/creator/ci20x11/system_get_property.cc b/src/starboard/contrib/creator/ci20x11/system_get_property.cc
index cb834af..fd4222c 100644
--- a/src/starboard/contrib/creator/ci20x11/system_get_property.cc
+++ b/src/starboard/contrib/creator/ci20x11/system_get_property.cc
@@ -14,8 +14,8 @@
#include "starboard/system.h"
-#include <linux/if.h> // NOLINT(build/include_alpha)
#include <netdb.h>
+#include <linux/if.h> // NOLINT(build/include_alpha)
#include <sys/ioctl.h>
#include <sys/socket.h>
diff --git a/src/starboard/contrib/creator/shared/compiler_flags.gypi b/src/starboard/contrib/creator/shared/compiler_flags.gypi
index 3cbdf7c..d3005f1 100644
--- a/src/starboard/contrib/creator/shared/compiler_flags.gypi
+++ b/src/starboard/contrib/creator/shared/compiler_flags.gypi
@@ -103,7 +103,7 @@
'defines': [
# By default, <EGL/eglplatform.h> pulls in some X11 headers that have some
# nasty macros (|Status|, for example) that conflict with Chromium base.
- #'MESA_EGL_NO_X11_HEADERS'
+ 'MESA_EGL_NO_X11_HEADERS'
],
'target_conditions': [
['clang==1', {
diff --git a/src/starboard/contrib/creator/shared/gyp_configuration.gypi b/src/starboard/contrib/creator/shared/gyp_configuration.gypi
index b853967..26a5869 100644
--- a/src/starboard/contrib/creator/shared/gyp_configuration.gypi
+++ b/src/starboard/contrib/creator/shared/gyp_configuration.gypi
@@ -24,7 +24,9 @@
'platform_libraries': [
'-lasound',
- '-ldl',
+ '-lavcodec',
+ '-lavformat',
+ '-lavutil',
'-lm',
'-lpthread',
'-lrt',
diff --git a/src/starboard/contrib/creator/shared/player_components_impl.cc b/src/starboard/contrib/creator/shared/player_components_impl.cc
index 3195d3a..95ae78c 100644
--- a/src/starboard/contrib/creator/shared/player_components_impl.cc
+++ b/src/starboard/contrib/creator/shared/player_components_impl.cc
@@ -27,7 +27,6 @@
#include "starboard/shared/starboard/player/filter/video_render_algorithm.h"
#include "starboard/shared/starboard/player/filter/video_render_algorithm_impl.h"
#include "starboard/shared/starboard/player/filter/video_renderer_sink.h"
-#include "starboard/time.h"
namespace starboard {
namespace shared {
@@ -47,9 +46,9 @@
SB_DCHECK(audio_decoder);
SB_DCHECK(audio_renderer_sink);
- scoped_ptr<AudioDecoderImpl> audio_decoder_impl(new AudioDecoderImpl(
+ scoped_ptr<AudioDecoderImpl> audio_decoder_impl(AudioDecoderImpl::Create(
audio_parameters.audio_codec, audio_parameters.audio_header));
- if (audio_decoder_impl->is_valid()) {
+ if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
audio_decoder->reset(audio_decoder_impl.release());
} else {
audio_decoder->reset();
@@ -73,10 +72,10 @@
video_decoder->reset();
scoped_ptr<FfmpegVideoDecoderImpl> ffmpeg_video_decoder(
- new FfmpegVideoDecoderImpl(
+ FfmpegVideoDecoderImpl::Create(
video_parameters.video_codec, video_parameters.output_mode,
video_parameters.decode_target_graphics_context_provider));
- if (ffmpeg_video_decoder->is_valid()) {
+ if (ffmpeg_video_decoder && ffmpeg_video_decoder->is_valid()) {
video_decoder->reset(ffmpeg_video_decoder.release());
}