From 52cbcb321df0cb2c831516f20b05edbc7dcd6828 Mon Sep 17 00:00:00 2001 From: Kongqun Yang Date: Fri, 19 Aug 2016 15:32:27 -0700 Subject: [PATCH] Add appveyor config for Windows CI Also fixes additional Windows build failures. Closes #22 Change-Id: I8bc416f1a44810c438f095ec137d0d102f4e08a5 --- .travis.yml | 2 +- DEPS | 6 --- README.md | 1 + appveyor.yml | 47 +++++++++++++++++++ packager/hls/base/master_playlist.cc | 12 ++++- packager/media/base/aes_decryptor.cc | 2 +- packager/media/file/memory_file.cc | 1 + packager/media/formats/mp2t/es_parser_adts.cc | 1 + packager/media/formats/mp2t/ts_section_psi.cc | 2 + .../media/formats/mp4/mp4_media_parser.cc | 1 + .../formats/mp4/multi_segment_segmenter.cc | 2 + packager/media/formats/webm/encryptor.cc | 5 +- .../media/formats/webm/webm_cluster_parser.cc | 1 + 13 files changed, 71 insertions(+), 12 deletions(-) create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index aa2f122f1f..330cf676cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ before_script: - gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged - gclient sync - cd src - - ninja -C out/${BUILD_TYPE} + - ninja -C out/${BUILD_TYPE} -k 100 script: - ( find out/${BUILD_TYPE} -name "*_*test" | while read i ; do $i || exit ; done ) diff --git a/DEPS b/DEPS index 51e63f3af0..045af3f3dd 100644 --- a/DEPS +++ b/DEPS @@ -90,12 +90,6 @@ hooks = [ 'action': ['python', 'src/packager/build/linux/sysroot_scripts/install-sysroot.py', '--running-as-hook'], }, - { - # Update the Windows toolchain if necessary. - 'name': 'win_toolchain', - 'pattern': '.', - 'action': ['python', 'src/packager/build/vs_toolchain.py', 'update'], - }, { # Update the Mac toolchain if necessary. 'name': 'mac_toolchain', diff --git a/README.md b/README.md index 9b32491b9e..ed30df6876 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # ![Shaka Packager](docs/shaka-packager.png) [![Build Status](https://travis-ci.org/google/shaka-packager.svg?branch=master)](https://travis-ci.org/google/shaka-packager) +[![Build status](https://ci.appveyor.com/api/projects/status/3t8iu603rp25sa74?svg=true)](https://ci.appveyor.com/project/shaka/shaka-packager) Media packaging SDK intended for C++ programmers writing DASH/HLS packager applications with common encryption support, Widevine DRM support, Live, and Video-On-Demand. diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..5c7e689d04 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,47 @@ +platform: + - x86 + - x64 + +configuration: + - Debug + - Release + +environment: + matrix: + - language: cpp + +clone_folder: c:\projects\shaka-packager\src + +install: + - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ..\depot_tools\ + +before_build: + - cd .. + - depot_tools\gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged + - depot_tools\gclient sync + +build_script: + - cd src + - ..\depot_tools\ninja -C "out\%CONFIGURATION%" -k 100 + - copy "out\%CONFIGURATION%\packager.exe" packager-win.exe + +test_script: + - for %%f in ("out\%CONFIGURATION%\*_*test.exe") do (%%f || exit /b 666) + - python "out\%CONFIGURATION%\packager_test.py" -v + +artifacts: + - path: packager-win.exe + +deploy: + provider: GitHub + auth_token: + secure: 0XTjRSDCHGH24WSnQRRizvhnaxK8gbq1cfivyuKQRrfwGPm7wpgiPL9SlyQ0aNdY + on: + appveyor_repo_tag: true + platform: x64 + configuration: Release + +branches: + only: + - master + - "/^v\\d+\\./" diff --git a/packager/hls/base/master_playlist.cc b/packager/hls/base/master_playlist.cc index 2cccc369bc..67182480e0 100644 --- a/packager/hls/base/master_playlist.cc +++ b/packager/hls/base/master_playlist.cc @@ -13,6 +13,7 @@ #include #include +#include "packager/base/files/file_path.h" #include "packager/base/strings/string_number_conversions.h" #include "packager/base/strings/stringprintf.h" #include "packager/hls/base/media_playlist.h" @@ -48,8 +49,12 @@ bool MasterPlaylist::WriteAllPlaylists(const std::string& base_url, } } + base::FilePath output_path = base::FilePath::FromUTF8Unsafe(output_dir); for (MediaPlaylist* playlist : media_playlists_) { - std::string file_path = output_dir + playlist->file_name(); + std::string file_path = + output_path + .Append(base::FilePath::FromUTF8Unsafe(playlist->file_name())) + .AsUTF8Unsafe(); if (!has_set_playlist_target_duration_) { const bool set_target_duration = playlist->SetTargetDuration( static_cast(ceil(longest_segment_duration))); @@ -75,7 +80,10 @@ bool MasterPlaylist::WriteAllPlaylists(const std::string& base_url, bool MasterPlaylist::WriteMasterPlaylist(const std::string& base_url, const std::string& output_dir) { - std::string file_path = output_dir + file_name_; + std::string file_path = + base::FilePath::FromUTF8Unsafe(output_dir) + .Append(base::FilePath::FromUTF8Unsafe(file_name_)) + .AsUTF8Unsafe(); std::unique_ptr file( media::File::Open(file_path.c_str(), "w")); if (!file) { diff --git a/packager/media/base/aes_decryptor.cc b/packager/media/base/aes_decryptor.cc index 514a29e808..c418718ceb 100644 --- a/packager/media/base/aes_decryptor.cc +++ b/packager/media/base/aes_decryptor.cc @@ -7,7 +7,7 @@ #include "packager/media/base/aes_decryptor.h" #include - +#include #include "packager/base/logging.h" namespace { diff --git a/packager/media/file/memory_file.cc b/packager/media/file/memory_file.cc index a3235502ae..e970f7ca65 100644 --- a/packager/media/file/memory_file.cc +++ b/packager/media/file/memory_file.cc @@ -8,6 +8,7 @@ #include // for memcpy +#include #include #include diff --git a/packager/media/formats/mp2t/es_parser_adts.cc b/packager/media/formats/mp2t/es_parser_adts.cc index 015bdfbf24..c8808d9a3b 100644 --- a/packager/media/formats/mp2t/es_parser_adts.cc +++ b/packager/media/formats/mp2t/es_parser_adts.cc @@ -6,6 +6,7 @@ #include +#include #include #include "packager/base/logging.h" diff --git a/packager/media/formats/mp2t/ts_section_psi.cc b/packager/media/formats/mp2t/ts_section_psi.cc index 2e9eb9bd7b..d5a293cf71 100644 --- a/packager/media/formats/mp2t/ts_section_psi.cc +++ b/packager/media/formats/mp2t/ts_section_psi.cc @@ -6,6 +6,8 @@ #include +#include + #include "packager/base/logging.h" #include "packager/media/base/bit_reader.h" #include "packager/media/formats/mp2t/mp2t_common.h" diff --git a/packager/media/formats/mp4/mp4_media_parser.cc b/packager/media/formats/mp4/mp4_media_parser.cc index 99e5f1efbe..bdc3e9f46c 100644 --- a/packager/media/formats/mp4/mp4_media_parser.cc +++ b/packager/media/formats/mp4/mp4_media_parser.cc @@ -4,6 +4,7 @@ #include "packager/media/formats/mp4/mp4_media_parser.h" +#include #include #include "packager/base/callback.h" diff --git a/packager/media/formats/mp4/multi_segment_segmenter.cc b/packager/media/formats/mp4/multi_segment_segmenter.cc index 39109a29e6..f47b3f814c 100644 --- a/packager/media/formats/mp4/multi_segment_segmenter.cc +++ b/packager/media/formats/mp4/multi_segment_segmenter.cc @@ -6,6 +6,8 @@ #include "packager/media/formats/mp4/multi_segment_segmenter.h" +#include + #include "packager/base/strings/string_number_conversions.h" #include "packager/base/strings/string_util.h" #include "packager/media/base/buffer_writer.h" diff --git a/packager/media/formats/webm/encryptor.cc b/packager/media/formats/webm/encryptor.cc index e425b32c9e..97fd0b33ac 100644 --- a/packager/media/formats/webm/encryptor.cc +++ b/packager/media/formats/webm/encryptor.cc @@ -102,7 +102,7 @@ Status Encryptor::EncryptFrame(scoped_refptr sample, return Status(error::MUXER_FAILURE, "Maximum number of VPx encryption partitions exceeded."); } - uint8_t num_partitions = + size_t num_partitions = vpx_frames.size() == 1 ? 1 : vpx_frames.size() * 2; size_t header_size = kWebMSignalByteSize + iv_size + kWebMNumPartitionsSize + @@ -113,7 +113,8 @@ Status Encryptor::EncryptFrame(scoped_refptr sample, sample_data[0] = kWebMEncryptedSignal | kWebMPartitionedSignal; memcpy(sample_data + kWebMSignalByteSize, encryptor_->iv().data(), iv_size); - sample_data[kWebMSignalByteSize + kWebMIvSize] = num_partitions; + sample_data[kWebMSignalByteSize + kWebMIvSize] = + static_cast(num_partitions); uint32_t partition_offset = 0; BufferWriter offsets_buffer(kWebMPartitionOffsetSize * num_partitions); for (const auto& vpx_frame : vpx_frames) { diff --git a/packager/media/formats/webm/webm_cluster_parser.cc b/packager/media/formats/webm/webm_cluster_parser.cc index 4d32103970..4f55202465 100644 --- a/packager/media/formats/webm/webm_cluster_parser.cc +++ b/packager/media/formats/webm/webm_cluster_parser.cc @@ -4,6 +4,7 @@ #include "packager/media/formats/webm/webm_cluster_parser.h" +#include #include #include "packager/base/logging.h"