From 06539c0865bcd8a2b135a3120abb028f6368e4f0 Mon Sep 17 00:00:00 2001
From: tikeda1110 <1514784+tikeda1110@users.noreply.github.com>
Date: Tue, 24 Sep 2019 18:29:53 +0900
Subject: [PATCH] Moved from RICOH_THETA_v2_SDK_for_iOS.0.1.1.zip
---
LICENSE.txt | 128 +-
LICENSE_ja.txt | 138 +-
README.txt | 229 +-
README_ja.txt | 229 +-
.../doc/Classes/GLRenderView.html | 2562 ++++++++--------
.../doc/Classes/GlkViewController.html | 458 +--
.../doc/Classes/HttpConnection.html | 2602 ++++++++---------
.../doc/Classes/HttpDeviceInfo.html | 670 ++---
.../doc/Classes/HttpFileList.html | 542 ++--
.../doc/Classes/HttpObjectInfo.html | 950 +++---
.../doc/Classes/HttpSession.html | 1028 +++----
.../doc/Classes/HttpStatusTimer.html | 674 ++---
.../doc/Classes/HttpStorageInfo.html | 758 ++---
.../doc/Classes/HttpStream.html | 1040 +++----
.../doc/Classes/SphereXmp.html | 1116 +++----
.../doc/Classes/TableCellObject.html | 358 +--
.../doc/Classes/UVSphere.html | 568 ++--
.../doc/css/scss/_index.scss | 34 +-
.../doc/css/scss/_layout.scss | 604 ++--
.../doc/css/scss/_normalize.scss | 1162 ++++----
.../doc/css/scss/_object.scss | 178 +-
.../doc/css/scss/_print.scss | 84 +-
.../doc/css/scss/_variables.scss | 22 +-
.../doc/css/scss/_xcode.scss | 58 +-
.../doc/css/scss/style.scss | 2 +-
.../doc/css/style.css | 4 +-
.../doc/hierarchy.html | 232 +-
ricoh-theta-sample-for-iosv2/doc/index.html | 204 +-
ricoh-theta-sample-for-iosv2/doc/js/script.js | 118 +-
.../project.pbxproj | 868 +++---
.../contents.xcworkspacedata | 7 -
.../ricoh-theta-sample-for-ios.xcscmblueprint | 25 -
...icoh-theta-sample-for-iosv2.xcscmblueprint | 27 -
.../UserInterfaceState.xcuserstate | Bin 10934 -> 0 bytes
.../ricoh-theta-sample-for-ios.xcscheme | 91 -
.../ricoh-theta-sample-for-iosv2.xcscheme | 91 -
.../xcschemes/xcschememanagement.plist | 22 -
.../AppDelegate.h | 22 +-
.../AppDelegate.m | 86 +-
.../ricoh-theta-sample-for-iosv2/Constants.h | 94 +-
.../GLRenderView.h | 40 +-
.../GLRenderView.m | 1322 ++++-----
.../ImageViewController.h | 62 +-
.../ImageViewController.m | 414 +--
.../ricoh-theta-sample-for-iosv2/SphereXmp.h | 28 +-
.../ricoh-theta-sample-for-iosv2/SphereXmp.m | 266 +-
.../ricoh-theta-sample-for-iosv2/TableCell.h | 22 +-
.../ricoh-theta-sample-for-iosv2/TableCell.m | 22 +-
.../TableCellObject.h | 40 +-
.../TableCellObject.m | 32 +-
.../ricoh-theta-sample-for-iosv2/UVSphere.h | 36 +-
.../ricoh-theta-sample-for-iosv2/UVSphere.m | 228 +-
.../ViewController.h | 34 +-
.../ViewController.m | 780 ++---
.../en.lproj/InfoPlist.strings | 4 +-
.../en.lproj/MainStoryboard.storyboard | 431 +--
.../glkViewController.h | 38 +-
.../glkViewController.m | 106 +-
.../http/HttpConnection.h | 94 +-
.../http/HttpConnection.m | 1248 ++++----
.../http/HttpDeviceInfo.h | 60 +-
.../http/HttpDeviceInfo.m | 36 +-
.../http/HttpFileList.h | 30 +-
.../http/HttpFileList.m | 220 +-
.../http/HttpImageInfo.h | 98 +-
.../http/HttpImageInfo.m | 46 +-
.../http/HttpSession.h | 38 +-
.../http/HttpSession.m | 210 +-
.../http/HttpStatusTimer.h | 30 +-
.../http/HttpStatusTimer.m | 200 +-
.../http/HttpStorageInfo.h | 66 +-
.../http/HttpStorageInfo.m | 18 +-
.../http/HttpStream.h | 34 +-
.../http/HttpStream.m | 322 +-
.../ricoh-theta-sample-for-iosv2/main.m | 28 +-
.../ricoh-theta-sample-for-iosv2-Info.plist | 86 +-
76 files changed, 12323 insertions(+), 12531 deletions(-)
delete mode 100755 ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2.xcodeproj/project.xcworkspace/contents.xcworkspacedata
delete mode 100755 ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2.xcodeproj/project.xcworkspace/xcshareddata/ricoh-theta-sample-for-ios.xcscmblueprint
delete mode 100755 ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2.xcodeproj/project.xcworkspace/xcshareddata/ricoh-theta-sample-for-iosv2.xcscmblueprint
delete mode 100755 ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2.xcodeproj/project.xcworkspace/xcuserdata/toshi.xcuserdatad/UserInterfaceState.xcuserstate
delete mode 100755 ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2.xcodeproj/xcuserdata/kobayashi.xcuserdatad/xcschemes/ricoh-theta-sample-for-ios.xcscheme
delete mode 100755 ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2.xcodeproj/xcuserdata/toshi.xcuserdatad/xcschemes/ricoh-theta-sample-for-iosv2.xcscheme
delete mode 100755 ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2.xcodeproj/xcuserdata/toshi.xcuserdatad/xcschemes/xcschememanagement.plist
diff --git a/LICENSE.txt b/LICENSE.txt
index edc19c7..6f0d917 100755
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,64 +1,64 @@
-End User License Agreement
-
-RICOH THETA SDK
-
-IMPORTANT –READ THIS END USER LICENSE AGREEMENT (“LICENSE AGREEMENT”) BEFORE INSTALLING OR USING ANY PART OF THE ABOVE SOFTWARE INCLUDING SOFTWARE AND ALL ACCOMPANYING DOCUMENTATION AND ANY AND ALL UPDATES AND MODIFICATIONS THERETO (“SOFTWARE”). INSTALLING OR USING ANY PART OF THE SOFTWARE INDICATES AND CONSTITUTES YOUR ACCEPTANCE OF THIS LICENSE AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE AGREEMENT, RICOH COMPANY, LTD. (“RICOH”) ARE UNWILLING TO LICENSE THE SOFTWARE TO YOU AND YOU MUST DISCONTINUE THE USE OR INSTALLATION OF THE SOFTWARE IMMEDIATELY.
-
-1. Definition.
-“Application Software” means any application software running in connection with and for use of Ricoh Product, which is developed by you in accordance with this License Agreement.
-“Intellectual Property Rights” means any and all rights under patent, copyright, trade secret, and trademark laws and international/multinational treaties, and any and all proprietary and other rights in connection therewith.
-“Ricoh Products” means the 360-degree camera RICOH THETA and its successors. Ricoh may separately specify the Ricoh Products on Ricoh’s website, in accompanying documentation or otherwise.
-“Marks” means trademark, service mark, company logo and trade name.
-
-2. License.
-Subject to the terms of this License Agreement, Ricoh grants you a limited, royalty-free, non-transferable, revocable and non-exclusive license to (a) use the Software solely for the purpose of designing or developing the Application Software and (b) distribute the Application Software and have any third party to use the Application Software solely for the purpose of using the Ricoh Product. You acknowledge and agree that Ricoh or third parties own all legal right, title and interest in and to the Software, including any Intellectual Property Rights that subsist in the Software.
-
-3. Restrictions.
-3.1 Subject to the terms of this License Agreement, you may copy, modify and create derivative works of the Software solely for the purpose set forth in Section 2.
-3.2 Except for as set forth in Section 3.1, you shall not copy, modify, decompile, reverse engineer, disassemble, attempt to derive source code or create derivative works of the Software or any part of the Software
-3.3 Except for as set forth in Section 3.1, you shall not share, distribute, lend, rent, lease, loan, sublicense, sell, assign, transfer or otherwise make available the Software or your rights under this License Agreement to any third party.
-3.4 Except for as set forth in Section 3.1, you shall not extract any portion of the Software for incorporation into other programs or for any other purpose.
-
-4. Application Software
-Ricoh makes no warranty of any kind, either express or implied, including without limitation, any warranty that the Ricoh Product works properly in connection with the Application Software. You shall, at your sole cost and expense, evaluate whether the Application Software works properly and correct any bugs and errors of the Application Software.
-
-5. Support from Ricoh
-Ricoh may, at its sole discretion, provide any technical information on the Software on its website. Notwithstanding the foregoing, Ricoh has no obligation to provide any support or advice to any third party or person, including without limitation, any support and advice for the development of the Application Software and the application and registration of the Application Software to application distribution website.
-
-6. Maintenance of the Application Software
-6.1 You shall, at your sole cost and expense, maintain and update the Application Software to work properly.
-6.2 You shall not make any misrepresentation which states, whether expresses or implied, that Ricoh is the developer, right holder or provider of the Application Software and its related services. Also you shall not use the Software for the purposes to violate, tamper with, or circumvent the security of any computer network, software, passwords, encryption codes, technological protection measures, or to otherwise engage in any kind of illegal activity, or to enable others to do so.
-6.3 Subject to Section 5, you may, at your sole cost and expense, provide any third party with any support and maintenance service in relation to the Application Software.
-6.4 You agree that if you use the Software to develop the Application Software for general public users, you will protect the privacy and legal rights of those users to comply with any applicable laws and regulations. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely.
-6.5 Ricoh may at any time, immediately terminate this License Agreement and you shall immediately cease using the Software and distributing the Application Software if Ricoh believes, in its sole discretion: (A) the Application Software is invisible to end users; (B) the end users of the Application Software do not easily delete or uninstall it; (C) the Application Software does not run to get the Product work properly; (D) the Application Software contains any contents which is not complied with Ricoh’s latest policy or Ricoh’s designated conditions; (E) the Application Software or any pictures or contents obtained through the Application Software infringe or is likely to infringe any third party’s Intellectual Property Rights or any third party’s rights of publicity or privacy or any other rights; and (F) the Application Software enables any party or person to use the Products in the way offensive to public order and moral.
-
-7. Changes to the Software or this License Agreement.
-From time to time, Ricoh may update or otherwise modify the Software, for example, but not limited to, for purposes of error correction, improvement of features, and enhancement of security features. Such updates or modifications may change or delete the nature of features or other aspects of the Software, including features you may rely upon. You hereby agree that such activities may occur at Ricoh’s sole discretion without liability to you. In the event of such updates or modifications, you shall use the latest version of the Software and modify the Application Software in accordance with such latest version of the Software at your sole cost and expense.
-
-8. Promotion
-8.1 Ricoh and Ricoh affiliates and their dealers may (a) introduce or promote the Application Software in connection with Ricoh Products on website, in promotion materials or at exhibitions; and (b) use your Mark on the promotion materials and package of the Ricoh Products and distribute such promotion materials.
-8.2 You grant Ricoh and Ricoh affiliates and their dealers a non-exclusive, non-transferrable, royalty-free license to use, distribute your Mark in connection with the promotion and distribution of the Ricoh Products.
-8.3 Nothing in this License Agreement gives you a right to use any of Ricoh’s Marks, domain names, or other distinctive brand features.
-
-9. Intellectual Property
-9.1 You acknowledge and agree that Ricoh or its licensors obtain all right, title and interest in and to the Software. Ricoh agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in and to any Application Software, including any intellectual Property Rights thereof.
-9.2 You acknowledge that the Software may include third party software subject to other terms and conditions governing the use of such software other than this License Agreement, including without limitation, open source software (“Open Source Software”). Terms and conditions applicable to the Open Source Software are provided to you together with this License Agreement, embedded in the Software or on Ricoh’s website.
-
-10. DISCLAIMER OF WARRANTIES.
-RICOH AND ITS LICENSORS DO NOT PROMISE THAT THE SOFTWARE (INCLUDING ITS FUNCTIONALITY OR FEATURES), OR INFORMATION THAT YOU RECEIVE FROM RICOH WILL BE ACCURATE, ERROR-FREE OR UNINTERRUPTED, OR THAT ANY DEFECTS WILL BE CORRECTED. YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SOFTWARE IS AT YOUR SOLE RISK AND THAT THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM RICOH. RICOH CANNOT ENSURE THAT ANY FILES, INFORMATION OR OTHER DATA YOU ACCESS OR DOWNLOAD FROM THE SOFTWARE WILL BE FREE OF VIRUSES OR CONTAMINATION OR DESTRUCTIVE FEATURES, AND RICOH AND ITS LICENSORS DISCLAIM ANY LIABILITY RELATED THERETO. YOUR USE OF THE SOFTWARE AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SOFTWARE IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. RICOH AND ITS LICENSORS FURTHER EXPRESSLY DISCLAIM ALL WARRANTIES, DUTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES, DUTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, ACCURACY AND NON-INFRINGEMENT. YOUR SOLE REMEDY AGAINST RICOH AND ITS LICENSORS FOR DISSATISFACTION WITH THE SOFTWARE IS TO STOP USING IT. THIS LIMITATION OF RELIEF IS A PART OF THE BARGAIN BETWEEN YOU AND RICOH. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY RICOH, ITS SUBSIDIARIES AND AFFILIATES, ITS LICENSORS, OR A RICOH AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY, DUTY OR CONDITION, OR IN ANY WAY CHANGE THIS EXCLUSION OF WARRANTY, DUTY AND CONDITION. You understand that Ricoh is under no obligation to provide updates, enhancements, or corrections, or to notify you of any product or service changes that Ricoh may make, or to publicly announce or introduce the product(s) or service at any time in the future.
-
-11. LIMITATION OF LIABILITY.
-YOU EXPRESSLY UNDERSTAND AND AGREE THAT RICOH, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU ARISING FROM OR RELATED TO THIS LICENSE AGREEMENT OR THE SOFTWARE UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF PROFITS, DATA, BUSINESS OR GOODWILL WHETHER OR NOT RICOH OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH DAMAGES AND LOSSES. Some jurisdictions may not allow exclusions or limitations of incidental or consequential damages, exclusions or limitations of implied warranties or conditions, or allow limitations on how long an implied warranty lasts, so the above limitations or exclusions may not apply to you in the event but only to the extent of any such disallowance.
-
-12. Indemnification.
-To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Ricoh, its subsidiaries, affiliates and their respective directors, officers, employees and agents (“Indemnified Party(s)”) from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ and experts’ fees and settlement costs) arising out of or accruing from (a) your use or misuse of the Software, (b) any application you design or develop using the Software or any pictures or contents obtained through such application that actually or allegedly infringes or misappropriates any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy or any other rights, and (c) any non-compliance by you with this License Agreement or any law, rule or regulation. You and your counsel will cooperate as fully as reasonably required by the Indemnified Party(s) in defense or settlement of any claim. Ricoh and/or Indemnified Party(s) reserve the right, at its own expense, to assume the exclusive defense or settlement, and control of any matter otherwise subject to indemnification by you. You shall not in any event consent to any judgment, settlement, attachment, or lien, or any other act adverse to the interest of any Indemnified Party without the prior written consent of Ricoh and/or Indemnified Party(s).
-
-13. Termination
-In case of any breach of this License Agreement, Ricoh may immediately terminate this License Agreement. Upon termination of this License Agreement, you shall immediately cease using the Software and distributing the Application Software
-
-14. Miscellaneous
-14.1 Ricoh may modify or revise the terms and conditions of this License Agreement upon prior notice to you by sending email to you, notifying on Ricoh’s website or any other reasonable means. If you do not accept such revised terms and conditions, you shall notify Ricoh thereof and cease using the Software before the effective date of such revised terms and conditions. Upon your use of the Software after the effective date of such revised terms and conditions, you are deemed to accept such revised terms and conditions.
-14.2 You agree that if Ricoh does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Ricoh has the benefit of under any applicable law), this will not be taken to be a formal waiver of Ricoh’s rights and that those rights or remedies will still be available to Ricoh. If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable.
-14.3 This License Agreement shall be governed by, construed and enforced in accordance with the laws of Japan, without regard to the principles of conflict of law thereof. All disputes, out of or in relation to or in connection with this License Agreement shall be finally settled by arbitration in Tokyo, Japan, in accordance with the Commercial Arbitration Rules of The Japan Commercial Arbitration Association. You agree that any violation of or non-compliance with any term or condition this License Agreement by you will constitute an unlawful and unfair business practice, and will cause irreparable harm to Ricoh, its affiliates or third party licensors for which monetary damages would be inadequate, and you consent to Ricoh obtaining any injunctive or equitable relief that Ricoh deems necessary or appropriate in such circumstances.
-14.4 This License Agreement contains the entire legal agreement between Ricoh and you relating to your use of the Software and supersedes all prior written or oral agreements, contracts or promises between Ricoh and you.
-14.5 This License Agreement may not be assigned or transferred by you without the prior written approval of Ricoh.
+End User License Agreement
+
+RICOH THETA SDK
+
+IMPORTANT –READ THIS END USER LICENSE AGREEMENT (“LICENSE AGREEMENT”) BEFORE INSTALLING OR USING ANY PART OF THE ABOVE SOFTWARE INCLUDING SOFTWARE AND ALL ACCOMPANYING DOCUMENTATION AND ANY AND ALL UPDATES AND MODIFICATIONS THERETO (“SOFTWARE”). INSTALLING OR USING ANY PART OF THE SOFTWARE INDICATES AND CONSTITUTES YOUR ACCEPTANCE OF THIS LICENSE AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE AGREEMENT, RICOH COMPANY, LTD. (“RICOH”) ARE UNWILLING TO LICENSE THE SOFTWARE TO YOU AND YOU MUST DISCONTINUE THE USE OR INSTALLATION OF THE SOFTWARE IMMEDIATELY.
+
+1. Definition.
+“Application Software” means any application software running in connection with and for use of Ricoh Product, which is developed by you in accordance with this License Agreement.
+“Intellectual Property Rights” means any and all rights under patent, copyright, trade secret, and trademark laws and international/multinational treaties, and any and all proprietary and other rights in connection therewith.
+“Ricoh Products” means the 360-degree camera RICOH THETA and its successors. Ricoh may separately specify the Ricoh Products on Ricoh’s website, in accompanying documentation or otherwise.
+“Marks” means trademark, service mark, company logo and trade name.
+
+2. License.
+Subject to the terms of this License Agreement, Ricoh grants you a limited, royalty-free, non-transferable, revocable and non-exclusive license to (a) use the Software solely for the purpose of designing or developing the Application Software and (b) distribute the Application Software and have any third party to use the Application Software solely for the purpose of using the Ricoh Product. You acknowledge and agree that Ricoh or third parties own all legal right, title and interest in and to the Software, including any Intellectual Property Rights that subsist in the Software.
+
+3. Restrictions.
+3.1 Subject to the terms of this License Agreement, you may copy, modify and create derivative works of the Software solely for the purpose set forth in Section 2.
+3.2 Except for as set forth in Section 3.1, you shall not copy, modify, decompile, reverse engineer, disassemble, attempt to derive source code or create derivative works of the Software or any part of the Software
+3.3 Except for as set forth in Section 3.1, you shall not share, distribute, lend, rent, lease, loan, sublicense, sell, assign, transfer or otherwise make available the Software or your rights under this License Agreement to any third party.
+3.4 Except for as set forth in Section 3.1, you shall not extract any portion of the Software for incorporation into other programs or for any other purpose.
+
+4. Application Software
+Ricoh makes no warranty of any kind, either express or implied, including without limitation, any warranty that the Ricoh Product works properly in connection with the Application Software. You shall, at your sole cost and expense, evaluate whether the Application Software works properly and correct any bugs and errors of the Application Software.
+
+5. Support from Ricoh
+Ricoh may, at its sole discretion, provide any technical information on the Software on its website. Notwithstanding the foregoing, Ricoh has no obligation to provide any support or advice to any third party or person, including without limitation, any support and advice for the development of the Application Software and the application and registration of the Application Software to application distribution website.
+
+6. Maintenance of the Application Software
+6.1 You shall, at your sole cost and expense, maintain and update the Application Software to work properly.
+6.2 You shall not make any misrepresentation which states, whether expresses or implied, that Ricoh is the developer, right holder or provider of the Application Software and its related services. Also you shall not use the Software for the purposes to violate, tamper with, or circumvent the security of any computer network, software, passwords, encryption codes, technological protection measures, or to otherwise engage in any kind of illegal activity, or to enable others to do so.
+6.3 Subject to Section 5, you may, at your sole cost and expense, provide any third party with any support and maintenance service in relation to the Application Software.
+6.4 You agree that if you use the Software to develop the Application Software for general public users, you will protect the privacy and legal rights of those users to comply with any applicable laws and regulations. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely.
+6.5 Ricoh may at any time, immediately terminate this License Agreement and you shall immediately cease using the Software and distributing the Application Software if Ricoh believes, in its sole discretion: (A) the Application Software is invisible to end users; (B) the end users of the Application Software do not easily delete or uninstall it; (C) the Application Software does not run to get the Product work properly; (D) the Application Software contains any contents which is not complied with Ricoh’s latest policy or Ricoh’s designated conditions; (E) the Application Software or any pictures or contents obtained through the Application Software infringe or is likely to infringe any third party’s Intellectual Property Rights or any third party’s rights of publicity or privacy or any other rights; and (F) the Application Software enables any party or person to use the Products in the way offensive to public order and moral.
+
+7. Changes to the Software or this License Agreement.
+From time to time, Ricoh may update or otherwise modify the Software, for example, but not limited to, for purposes of error correction, improvement of features, and enhancement of security features. Such updates or modifications may change or delete the nature of features or other aspects of the Software, including features you may rely upon. You hereby agree that such activities may occur at Ricoh’s sole discretion without liability to you. In the event of such updates or modifications, you shall use the latest version of the Software and modify the Application Software in accordance with such latest version of the Software at your sole cost and expense.
+
+8. Promotion
+8.1 Ricoh and Ricoh affiliates and their dealers may (a) introduce or promote the Application Software in connection with Ricoh Products on website, in promotion materials or at exhibitions; and (b) use your Mark on the promotion materials and package of the Ricoh Products and distribute such promotion materials.
+8.2 You grant Ricoh and Ricoh affiliates and their dealers a non-exclusive, non-transferrable, royalty-free license to use, distribute your Mark in connection with the promotion and distribution of the Ricoh Products.
+8.3 Nothing in this License Agreement gives you a right to use any of Ricoh’s Marks, domain names, or other distinctive brand features.
+
+9. Intellectual Property
+9.1 You acknowledge and agree that Ricoh or its licensors obtain all right, title and interest in and to the Software. Ricoh agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in and to any Application Software, including any intellectual Property Rights thereof.
+9.2 You acknowledge that the Software may include third party software subject to other terms and conditions governing the use of such software other than this License Agreement, including without limitation, open source software (“Open Source Software”). Terms and conditions applicable to the Open Source Software are provided to you together with this License Agreement, embedded in the Software or on Ricoh’s website.
+
+10. DISCLAIMER OF WARRANTIES.
+RICOH AND ITS LICENSORS DO NOT PROMISE THAT THE SOFTWARE (INCLUDING ITS FUNCTIONALITY OR FEATURES), OR INFORMATION THAT YOU RECEIVE FROM RICOH WILL BE ACCURATE, ERROR-FREE OR UNINTERRUPTED, OR THAT ANY DEFECTS WILL BE CORRECTED. YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SOFTWARE IS AT YOUR SOLE RISK AND THAT THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM RICOH. RICOH CANNOT ENSURE THAT ANY FILES, INFORMATION OR OTHER DATA YOU ACCESS OR DOWNLOAD FROM THE SOFTWARE WILL BE FREE OF VIRUSES OR CONTAMINATION OR DESTRUCTIVE FEATURES, AND RICOH AND ITS LICENSORS DISCLAIM ANY LIABILITY RELATED THERETO. YOUR USE OF THE SOFTWARE AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SOFTWARE IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. RICOH AND ITS LICENSORS FURTHER EXPRESSLY DISCLAIM ALL WARRANTIES, DUTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES, DUTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, ACCURACY AND NON-INFRINGEMENT. YOUR SOLE REMEDY AGAINST RICOH AND ITS LICENSORS FOR DISSATISFACTION WITH THE SOFTWARE IS TO STOP USING IT. THIS LIMITATION OF RELIEF IS A PART OF THE BARGAIN BETWEEN YOU AND RICOH. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY RICOH, ITS SUBSIDIARIES AND AFFILIATES, ITS LICENSORS, OR A RICOH AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY, DUTY OR CONDITION, OR IN ANY WAY CHANGE THIS EXCLUSION OF WARRANTY, DUTY AND CONDITION. You understand that Ricoh is under no obligation to provide updates, enhancements, or corrections, or to notify you of any product or service changes that Ricoh may make, or to publicly announce or introduce the product(s) or service at any time in the future.
+
+11. LIMITATION OF LIABILITY.
+YOU EXPRESSLY UNDERSTAND AND AGREE THAT RICOH, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU ARISING FROM OR RELATED TO THIS LICENSE AGREEMENT OR THE SOFTWARE UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF PROFITS, DATA, BUSINESS OR GOODWILL WHETHER OR NOT RICOH OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH DAMAGES AND LOSSES. Some jurisdictions may not allow exclusions or limitations of incidental or consequential damages, exclusions or limitations of implied warranties or conditions, or allow limitations on how long an implied warranty lasts, so the above limitations or exclusions may not apply to you in the event but only to the extent of any such disallowance.
+
+12. Indemnification.
+To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Ricoh, its subsidiaries, affiliates and their respective directors, officers, employees and agents (“Indemnified Party(s)”) from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ and experts’ fees and settlement costs) arising out of or accruing from (a) your use or misuse of the Software, (b) any application you design or develop using the Software or any pictures or contents obtained through such application that actually or allegedly infringes or misappropriates any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy or any other rights, and (c) any non-compliance by you with this License Agreement or any law, rule or regulation. You and your counsel will cooperate as fully as reasonably required by the Indemnified Party(s) in defense or settlement of any claim. Ricoh and/or Indemnified Party(s) reserve the right, at its own expense, to assume the exclusive defense or settlement, and control of any matter otherwise subject to indemnification by you. You shall not in any event consent to any judgment, settlement, attachment, or lien, or any other act adverse to the interest of any Indemnified Party without the prior written consent of Ricoh and/or Indemnified Party(s).
+
+13. Termination
+In case of any breach of this License Agreement, Ricoh may immediately terminate this License Agreement. Upon termination of this License Agreement, you shall immediately cease using the Software and distributing the Application Software
+
+14. Miscellaneous
+14.1 Ricoh may modify or revise the terms and conditions of this License Agreement upon prior notice to you by sending email to you, notifying on Ricoh’s website or any other reasonable means. If you do not accept such revised terms and conditions, you shall notify Ricoh thereof and cease using the Software before the effective date of such revised terms and conditions. Upon your use of the Software after the effective date of such revised terms and conditions, you are deemed to accept such revised terms and conditions.
+14.2 You agree that if Ricoh does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Ricoh has the benefit of under any applicable law), this will not be taken to be a formal waiver of Ricoh’s rights and that those rights or remedies will still be available to Ricoh. If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable.
+14.3 This License Agreement shall be governed by, construed and enforced in accordance with the laws of Japan, without regard to the principles of conflict of law thereof. All disputes, out of or in relation to or in connection with this License Agreement shall be finally settled by arbitration in Tokyo, Japan, in accordance with the Commercial Arbitration Rules of The Japan Commercial Arbitration Association. You agree that any violation of or non-compliance with any term or condition this License Agreement by you will constitute an unlawful and unfair business practice, and will cause irreparable harm to Ricoh, its affiliates or third party licensors for which monetary damages would be inadequate, and you consent to Ricoh obtaining any injunctive or equitable relief that Ricoh deems necessary or appropriate in such circumstances.
+14.4 This License Agreement contains the entire legal agreement between Ricoh and you relating to your use of the Software and supersedes all prior written or oral agreements, contracts or promises between Ricoh and you.
+14.5 This License Agreement may not be assigned or transferred by you without the prior written approval of Ricoh.
diff --git a/LICENSE_ja.txt b/LICENSE_ja.txt
index a2a2857..a525c0c 100755
--- a/LICENSE_ja.txt
+++ b/LICENSE_ja.txt
@@ -1,69 +1,69 @@
-ソフトウェア使用許諾契約書
-
-RICOH THETA SDK
-
-上記ソフトウェア(コンピューターソフトウェア、マニュアルなどの関連書類及び電子文書並びにそれらのアップデート・アップグレード版を含み、以下、本ソフトウェアといいます)をご使用になる前に、以下の使用条件をよくお読み下さい。
-お客様が同意する旨のボタンをクリックまたは本ソフトウェアをご使用になられた時点で、お客様が以下の使用条件に同意して、お客様と株式会社リコー(以下、リコーといいます)との間で契約が成立したものとさせていただきます。万が一、本契約の条件にご同意頂けない場合には、本ソフトウェアのご使用はお控え頂きますようお願い致します。
-
-使用条件
-
-第1条(定義)
-本契約において使用する次の用語は、以下に定める意味を有するものとします。
-1. 「開発ソフトウェア」とは、本契約に基づき、お客様が、本製品を作動させるように設計したアプリケーションプログラムを指します。
-2. 「知的財産権」とは、工業所有権に関する法律、著作権法若しくはその他の法律による保護を受けられる権利を指します。
-3. 「本製品」とは、RICOH THETAを指します(後継機種を含みます)。なお、リコーが、本ソフトウェアの関連文書、自社のウェブサイトその他の方法にて「本製品」の対象を指定できるものとします。
-4. 「お客様のマーク」とは、お客様が権利を保有する、商標、商号、ロゴ及びそれらに類する表示を指します。
-
-第2条(使用権)
-リコーは、お客様に対して、本契約に定める条件に基づき、お客様が、(1)開発ソフトウェアを開発する目的に限り、本ソフトウェアを使用し、または参照すること、及び、(2)本製品を使用する目的に限定して、第三者(以下「エンドユーザー」といいます)に対して開発ソフトウェアの使用を許諾し、頒布することにつき、非独占的且つ譲渡不可能な権利を許諾します。
-
-第3条(権利の制限)
-1. お客様は、第2条に定める目的の範囲内において本ソフトウェアを修正、追加等の改変を行うことができるものとします。
-2. お客様は、本ソフトウェアに関しリバースエンジニアリング、逆アセンブル、逆コンパイル等解析作業を行ってはならないものとします。
-3. お客様は、別途本契約において明示的に規定されている場合を除き、本ソフトウェアを再使用許諾、貸与又はリースその他の方法で第三者に使用させてはならないものとします。
-4. お客様は、別途本契約において明示的に規定されている場合を除き、本ソフトウェアの一部又はその構成部分を本ソフトウェアから分離して使用しないものとします。
-
-第4条(動作確認)
-リコーは、開発ソフトウェアが本製品を正しく作動させることについて一切の保証をしません。お客様は、ご自身の費用で、開発ソフトウェアが本製品を正しく作動させるか否か、確認を行い、開発ソフトウェアが本製品を正しく作動させない場合、お客様の費用で開発ソフトウェアを修正するものとします。
-
-第5条(リコーからのサポート)
-1. リコーは、自己の裁量において、リコーのウェブサイト上で本ソフトウェアに関する技術情報を掲載する場合があります。但し、いかなる場合においても、リコーは、お客様に対して本ソフトウェアに関するサポートやアドバイス等の一切を提供する義務を負わないものとします。
-2. リコーは、第三者の提供しているアプリ配布システムに開発ソフトウェアを登録する場合など、お客様の開発ソフトウェアをお客様が頒布する際に、サポートやアドバイス等の一切の協力を行う義務を負わないものとします。
-
-第6条(開発ソフトウェアのメンテナンス及びサポート)
-1. お客様は、本製品上で開発ソフトウェアが正しく作動するよう、開発ソフトウェアのメンテナンスを行い、且つ、アップデートを行うものとします。
-2. お客様は、エンドユーザーに対して、開発ソフトウェアの開発者又は権利者がリコー又はリコーの関連会社であるかのような誤解を生じさせるような行為を一切行わないものとします。
-3. お客様は、ご自身の費用で、開発ソフトウェアのエンドユーザーに対してサポートを提供するものとします。お客様とエンドユーザーとの間で開発ソフトウェアに関連した紛争を生じたときは、お客様自身が自らの費用で解決するものとし、リコー及びリコーの関連会社に一切の迷惑をかけないものとします。
-4. お客様がエンドユーザーから個人情報を収集する場合は、個人情報に関して適用される法令、条例及び規則を遵守するものとします。お客様による個人情報の収集やその取り扱いについて紛争を生じたときは、お客様自身が自らの費用で解決するものとし、リコー及びリコーの関連会社に一切の迷惑をかけないものとします。
-5. リコーが、自己の裁量で、(1)開発ソフトウェアが、エンドユーザーにより容易かつ可視的に特定できないものであると判断した場合、(2)開発ソフトウェアが、エンドユーザーにより、システム等からアンインストール及び削除することが容易にできないものである可能性があると判断した場合、(3)開発ソフトウェアが本製品を正しく作動させないものであると判断した場合、(4)開発ソフトウェアが、その時点でリコーから提供されている最新のポリシーその他の条件に合致しないコンテンツを含んでいる又は提供していると判断した場合、(5)開発ソフトウェアまたは開発ソフトウェアにより取得する画像またはコンテンツが第三者の知的財産権又は肖像権、プライバシー権、パブリシティ権その他一切の権利を侵害している、又は侵害する虞があると判断した場合、(6)開発ソフトウェアにより、本製品を公序良俗に反する方法にて利用することができるようになる場合、又は、(7)その他、開発ソフトウェアがエンドユーザーに対して悪影響を与えると合理的に判断した場合、リコーは、お客様に対して、開発ソフトウェアの頒布を中止するよう要求し、お客様は、直ちにその要求に従うものとします。
-
-第7条(修正・アップデート)
-本ソフトウェアのアップグレード版、アップデート版又はバクを修正する等何等かの修正が為されたバージョンが、リコーが適切と判断した方法で、公開される場合があります。かかる本ソフトウェアが公開された場合、お客様は、修正後の本ソフトウェアを使用し、お客様の費用で開発ソフトウェアを修正するものとします。
-
-第8条(販促活動)
-1. リコー、リコーの関連会社及び各々の代理店は、(1)それぞれのウェブサイト、販促資料や展示等を通じて、本製品に関連して開発ソフトウェアを紹介又は宣伝したり、(2)本製品の販促資料及び梱包にお客様のマークを掲載して、使用、展示又は頒布することができるものとします(以下、これらの活動を「販促活動」といいます)。
-2. お客様は、リコー及びリコーの関連会社に対して、本製品の広告、宣伝、梱包に関連して、お客様のマークを使用し、表示し、頒布する、非独占的且つ譲渡不可能な権利を無償で許諾します。当該権利には、リコー又はリコーの関連会社が、自己の代理店に対して、お客様のマークを使用させる権利を含むものとします。
-3. お客様は、リコー又はリコーの関連会社が権利を保有する商標、商号、ロゴ及びそれらに類する表示を使用してはならないものとします。
-
-第9条(知的財産権)
-1. リコー及びお客様は、(1)本ソフトウェアに関する権利がリコーまたはリコーのライセンサーに帰属し、本契約において明示的に規定されている場合を除き、お客様が本ソフトウェアに関して何等の権利も有しないこと、(2)お客様のマーク及び開発ソフトウェアに関する権利はお客様に帰属し、本契約において明示的に規定されている場合を除き、リコーがお客様のマーク及び開発ソフトウェアに関して何等の権利も有しないことを確認します。
-2. 本ソフトウェアには、オープンソフトウェア等の第三者の知的財産権の対象となるもの(以下、第三者権利物)が含まれることがあります。第三者権利物については、本契約の対象とならず、第三者権利物の権利者から使用許諾されます。当該使用条件については、本ソフトウェアの所定ファイルまたはリコーのウェブサイトをご確認ください。
-
-第10条(無保証)
-リコーは、本ソフトウェアを現状有姿でお客様に対して提供するものとします。リコーは、お客様に対して、本ソフトウェア及び開発ソフトウェアに関し、エラー・バグ等の不具合がないこと、中断なく稼動すること、安全、有効、正確であること、お客様の使用目的に合致していること、第三者の権利を侵害していないこと等を含め、明示・黙示を問わず何らの保証も行わないものとします。本ソフトウェアを使用したこと及び使用できなかったこと、及び開発ソフトウェアを開発したこと及びできなかったことに関して、お客様又は第三者に生じた損害については、全てお客様が負担するものとし、リコーに対して一切の責任及び損害も及ぼさないものとします。
-
-第11条(補償)
-(1)お客様が本ソフトウェアを利用したこと、(2)お客様が本契約に定める条項に違反したこと、または(3)お客様のマーク、開発ソフトウェア、又は開発ソフトウェアを通じて頒布又は入手可能となる画像又はコンテンツ等が第三者の知的財産権又は肖像権、プライバシー権、パブリシティ権その他一切の権利を侵害することに、直接的又は間接的に起因して、リコー及びリコーの関連会社に対する紛争が生じ、リコー及びリコーの関連会社に損害が生じた場合は、お客様は、リコー及びリコーの関連会社に対して、当該損害の一切を補償し、リコー及びリコーの関連会社に一切迷惑をかけないものとします。
-
-第12条(責任制限)
-リコー、リコーの関連会社の故意又は重過失による場合を除き、リコー、リコーの関連会社及び原権利者は、お客様に対して、本ソフトウェアに関して、如何なる損害賠償責任も負わないものとします。
-
-第13条(契約の解約)
-リコーは、お客様が本契約に定める条項に違反した場合、本契約を解約することができるものとします。この場合、お客様は、自らの費用で、開発ソフトウェアの頒布及び本ソフトウェアの使用を直ちに中止し、本ソフトウェア及びその複製物を廃棄するものとします。
-
-第14条(その他)
-1. リコーはお客様が登録した電子メールアドレスへの電子メールの発信、リコー所定のサイトでの告知又はその他リコーが適切と判断する方法をもってお客様に事前に通知することにより、本契約の条件を改訂することがあります。お客様はかかる改訂に同意しない場合は、本契約の条件改定の発効日前までに、リコーにその旨を連絡するとともに直ちに本ソフトウェアの使用を中止するものとします。本契約の条件改訂の発効日以降のお客様による本ソフトウェアの使用をもって、お客様は改訂されたソフトウェア使用許諾契約に同意したものとします。
-2. 本契約(改訂版を含む)は、本ソフトウェアに関して、リコーとお客様との間での合意事項を定めたものです。リコーが本契約上の権利を行使しない場合又は本契約上の規定に基づき該当する義務の履行を請求しない場合であっても、それらのことをもって、リコーが当該権利や義務の履行の請求を放棄したとは見なされないものとします。本契約の一部が法律上又は裁判所の判断によって無効とされた場合でも、無効であるとされた当該条項以外の規定は引き続き、リコーとお客様との間で有効に存続するものとします。
-3. 国際物品売買契約に関する国際連合条約は、本契約には適用されないものとします。本契約は、日本国法に準拠するものとします。本契約の規定の解釈又はこれらに規定なき事項について、リコーとお客様との間で疑義又は紛争が生じたときは、リコー及びお客様は、東京地方裁判所を第一審の専属的合意管轄裁判所とするものとします。
-4. 本契約は、本契約に基づく権利および義務に関する両当事者間の完全なる合意および了解事項を構成するものとし、本契約に関連する事前の合意、約束、協定、表示、および了解事項はすべて、明示的か黙示的、口頭か書面によるかにかかわらず、本契約が優先するものとします。
-5. リコーから書面による事前の承諾を得た場合を除き、本契約に基づく権利および義務の一部または全部をいかなる第三者に対しても譲渡することはできないものとします。
+ソフトウェア使用許諾契約書
+
+RICOH THETA SDK
+
+上記ソフトウェア(コンピューターソフトウェア、マニュアルなどの関連書類及び電子文書並びにそれらのアップデート・アップグレード版を含み、以下、本ソフトウェアといいます)をご使用になる前に、以下の使用条件をよくお読み下さい。
+お客様が同意する旨のボタンをクリックまたは本ソフトウェアをご使用になられた時点で、お客様が以下の使用条件に同意して、お客様と株式会社リコー(以下、リコーといいます)との間で契約が成立したものとさせていただきます。万が一、本契約の条件にご同意頂けない場合には、本ソフトウェアのご使用はお控え頂きますようお願い致します。
+
+使用条件
+
+第1条(定義)
+本契約において使用する次の用語は、以下に定める意味を有するものとします。
+1. 「開発ソフトウェア」とは、本契約に基づき、お客様が、本製品を作動させるように設計したアプリケーションプログラムを指します。
+2. 「知的財産権」とは、工業所有権に関する法律、著作権法若しくはその他の法律による保護を受けられる権利を指します。
+3. 「本製品」とは、RICOH THETAを指します(後継機種を含みます)。なお、リコーが、本ソフトウェアの関連文書、自社のウェブサイトその他の方法にて「本製品」の対象を指定できるものとします。
+4. 「お客様のマーク」とは、お客様が権利を保有する、商標、商号、ロゴ及びそれらに類する表示を指します。
+
+第2条(使用権)
+リコーは、お客様に対して、本契約に定める条件に基づき、お客様が、(1)開発ソフトウェアを開発する目的に限り、本ソフトウェアを使用し、または参照すること、及び、(2)本製品を使用する目的に限定して、第三者(以下「エンドユーザー」といいます)に対して開発ソフトウェアの使用を許諾し、頒布することにつき、非独占的且つ譲渡不可能な権利を許諾します。
+
+第3条(権利の制限)
+1. お客様は、第2条に定める目的の範囲内において本ソフトウェアを修正、追加等の改変を行うことができるものとします。
+2. お客様は、本ソフトウェアに関しリバースエンジニアリング、逆アセンブル、逆コンパイル等解析作業を行ってはならないものとします。
+3. お客様は、別途本契約において明示的に規定されている場合を除き、本ソフトウェアを再使用許諾、貸与又はリースその他の方法で第三者に使用させてはならないものとします。
+4. お客様は、別途本契約において明示的に規定されている場合を除き、本ソフトウェアの一部又はその構成部分を本ソフトウェアから分離して使用しないものとします。
+
+第4条(動作確認)
+リコーは、開発ソフトウェアが本製品を正しく作動させることについて一切の保証をしません。お客様は、ご自身の費用で、開発ソフトウェアが本製品を正しく作動させるか否か、確認を行い、開発ソフトウェアが本製品を正しく作動させない場合、お客様の費用で開発ソフトウェアを修正するものとします。
+
+第5条(リコーからのサポート)
+1. リコーは、自己の裁量において、リコーのウェブサイト上で本ソフトウェアに関する技術情報を掲載する場合があります。但し、いかなる場合においても、リコーは、お客様に対して本ソフトウェアに関するサポートやアドバイス等の一切を提供する義務を負わないものとします。
+2. リコーは、第三者の提供しているアプリ配布システムに開発ソフトウェアを登録する場合など、お客様の開発ソフトウェアをお客様が頒布する際に、サポートやアドバイス等の一切の協力を行う義務を負わないものとします。
+
+第6条(開発ソフトウェアのメンテナンス及びサポート)
+1. お客様は、本製品上で開発ソフトウェアが正しく作動するよう、開発ソフトウェアのメンテナンスを行い、且つ、アップデートを行うものとします。
+2. お客様は、エンドユーザーに対して、開発ソフトウェアの開発者又は権利者がリコー又はリコーの関連会社であるかのような誤解を生じさせるような行為を一切行わないものとします。
+3. お客様は、ご自身の費用で、開発ソフトウェアのエンドユーザーに対してサポートを提供するものとします。お客様とエンドユーザーとの間で開発ソフトウェアに関連した紛争を生じたときは、お客様自身が自らの費用で解決するものとし、リコー及びリコーの関連会社に一切の迷惑をかけないものとします。
+4. お客様がエンドユーザーから個人情報を収集する場合は、個人情報に関して適用される法令、条例及び規則を遵守するものとします。お客様による個人情報の収集やその取り扱いについて紛争を生じたときは、お客様自身が自らの費用で解決するものとし、リコー及びリコーの関連会社に一切の迷惑をかけないものとします。
+5. リコーが、自己の裁量で、(1)開発ソフトウェアが、エンドユーザーにより容易かつ可視的に特定できないものであると判断した場合、(2)開発ソフトウェアが、エンドユーザーにより、システム等からアンインストール及び削除することが容易にできないものである可能性があると判断した場合、(3)開発ソフトウェアが本製品を正しく作動させないものであると判断した場合、(4)開発ソフトウェアが、その時点でリコーから提供されている最新のポリシーその他の条件に合致しないコンテンツを含んでいる又は提供していると判断した場合、(5)開発ソフトウェアまたは開発ソフトウェアにより取得する画像またはコンテンツが第三者の知的財産権又は肖像権、プライバシー権、パブリシティ権その他一切の権利を侵害している、又は侵害する虞があると判断した場合、(6)開発ソフトウェアにより、本製品を公序良俗に反する方法にて利用することができるようになる場合、又は、(7)その他、開発ソフトウェアがエンドユーザーに対して悪影響を与えると合理的に判断した場合、リコーは、お客様に対して、開発ソフトウェアの頒布を中止するよう要求し、お客様は、直ちにその要求に従うものとします。
+
+第7条(修正・アップデート)
+本ソフトウェアのアップグレード版、アップデート版又はバクを修正する等何等かの修正が為されたバージョンが、リコーが適切と判断した方法で、公開される場合があります。かかる本ソフトウェアが公開された場合、お客様は、修正後の本ソフトウェアを使用し、お客様の費用で開発ソフトウェアを修正するものとします。
+
+第8条(販促活動)
+1. リコー、リコーの関連会社及び各々の代理店は、(1)それぞれのウェブサイト、販促資料や展示等を通じて、本製品に関連して開発ソフトウェアを紹介又は宣伝したり、(2)本製品の販促資料及び梱包にお客様のマークを掲載して、使用、展示又は頒布することができるものとします(以下、これらの活動を「販促活動」といいます)。
+2. お客様は、リコー及びリコーの関連会社に対して、本製品の広告、宣伝、梱包に関連して、お客様のマークを使用し、表示し、頒布する、非独占的且つ譲渡不可能な権利を無償で許諾します。当該権利には、リコー又はリコーの関連会社が、自己の代理店に対して、お客様のマークを使用させる権利を含むものとします。
+3. お客様は、リコー又はリコーの関連会社が権利を保有する商標、商号、ロゴ及びそれらに類する表示を使用してはならないものとします。
+
+第9条(知的財産権)
+1. リコー及びお客様は、(1)本ソフトウェアに関する権利がリコーまたはリコーのライセンサーに帰属し、本契約において明示的に規定されている場合を除き、お客様が本ソフトウェアに関して何等の権利も有しないこと、(2)お客様のマーク及び開発ソフトウェアに関する権利はお客様に帰属し、本契約において明示的に規定されている場合を除き、リコーがお客様のマーク及び開発ソフトウェアに関して何等の権利も有しないことを確認します。
+2. 本ソフトウェアには、オープンソフトウェア等の第三者の知的財産権の対象となるもの(以下、第三者権利物)が含まれることがあります。第三者権利物については、本契約の対象とならず、第三者権利物の権利者から使用許諾されます。当該使用条件については、本ソフトウェアの所定ファイルまたはリコーのウェブサイトをご確認ください。
+
+第10条(無保証)
+リコーは、本ソフトウェアを現状有姿でお客様に対して提供するものとします。リコーは、お客様に対して、本ソフトウェア及び開発ソフトウェアに関し、エラー・バグ等の不具合がないこと、中断なく稼動すること、安全、有効、正確であること、お客様の使用目的に合致していること、第三者の権利を侵害していないこと等を含め、明示・黙示を問わず何らの保証も行わないものとします。本ソフトウェアを使用したこと及び使用できなかったこと、及び開発ソフトウェアを開発したこと及びできなかったことに関して、お客様又は第三者に生じた損害については、全てお客様が負担するものとし、リコーに対して一切の責任及び損害も及ぼさないものとします。
+
+第11条(補償)
+(1)お客様が本ソフトウェアを利用したこと、(2)お客様が本契約に定める条項に違反したこと、または(3)お客様のマーク、開発ソフトウェア、又は開発ソフトウェアを通じて頒布又は入手可能となる画像又はコンテンツ等が第三者の知的財産権又は肖像権、プライバシー権、パブリシティ権その他一切の権利を侵害することに、直接的又は間接的に起因して、リコー及びリコーの関連会社に対する紛争が生じ、リコー及びリコーの関連会社に損害が生じた場合は、お客様は、リコー及びリコーの関連会社に対して、当該損害の一切を補償し、リコー及びリコーの関連会社に一切迷惑をかけないものとします。
+
+第12条(責任制限)
+リコー、リコーの関連会社の故意又は重過失による場合を除き、リコー、リコーの関連会社及び原権利者は、お客様に対して、本ソフトウェアに関して、如何なる損害賠償責任も負わないものとします。
+
+第13条(契約の解約)
+リコーは、お客様が本契約に定める条項に違反した場合、本契約を解約することができるものとします。この場合、お客様は、自らの費用で、開発ソフトウェアの頒布及び本ソフトウェアの使用を直ちに中止し、本ソフトウェア及びその複製物を廃棄するものとします。
+
+第14条(その他)
+1. リコーはお客様が登録した電子メールアドレスへの電子メールの発信、リコー所定のサイトでの告知又はその他リコーが適切と判断する方法をもってお客様に事前に通知することにより、本契約の条件を改訂することがあります。お客様はかかる改訂に同意しない場合は、本契約の条件改定の発効日前までに、リコーにその旨を連絡するとともに直ちに本ソフトウェアの使用を中止するものとします。本契約の条件改訂の発効日以降のお客様による本ソフトウェアの使用をもって、お客様は改訂されたソフトウェア使用許諾契約に同意したものとします。
+2. 本契約(改訂版を含む)は、本ソフトウェアに関して、リコーとお客様との間での合意事項を定めたものです。リコーが本契約上の権利を行使しない場合又は本契約上の規定に基づき該当する義務の履行を請求しない場合であっても、それらのことをもって、リコーが当該権利や義務の履行の請求を放棄したとは見なされないものとします。本契約の一部が法律上又は裁判所の判断によって無効とされた場合でも、無効であるとされた当該条項以外の規定は引き続き、リコーとお客様との間で有効に存続するものとします。
+3. 国際物品売買契約に関する国際連合条約は、本契約には適用されないものとします。本契約は、日本国法に準拠するものとします。本契約の規定の解釈又はこれらに規定なき事項について、リコーとお客様との間で疑義又は紛争が生じたときは、リコー及びお客様は、東京地方裁判所を第一審の専属的合意管轄裁判所とするものとします。
+4. 本契約は、本契約に基づく権利および義務に関する両当事者間の完全なる合意および了解事項を構成するものとし、本契約に関連する事前の合意、約束、協定、表示、および了解事項はすべて、明示的か黙示的、口頭か書面によるかにかかわらず、本契約が優先するものとします。
+5. リコーから書面による事前の承諾を得た場合を除き、本契約に基づく権利および義務の一部または全部をいかなる第三者に対しても譲渡することはできないものとします。
diff --git a/README.txt b/README.txt
index 3e13ee6..19b42e8 100755
--- a/README.txt
+++ b/README.txt
@@ -1,114 +1,115 @@
-==================================================
- README for "RICOH THETA v2 SDK for iOS"
-
- Version :0.1.0
-==================================================
-
-This file is an explanation document for RICOH THETA v2 SDK for iOS.
-However, this document assumes that you have already registered as an iOS developer and that you are able to develop apps for iOS.
-
-----------------------------------------
-
-* Contents of this Document
-
- * Terms of Service
- * Files included in the archive
- * Required environment for development
- * How to Use
- * Latest information
- * Troubleshooting
- * Trademarks
- * Update History
-
-----------------------------------------
-
-* Terms of Service
-
- Terms of service are included in the LICENSE.txt (LICENSE_ja.txt) file.
- It is assumed that you have agreed to these terms of service when you start using RICOH THETA v2 SDK.
-
-----------------------------------------
-
-* Files included in the archive
-
- README.txt: This file (English)
- README_ja.txt: This file (Japanese)
- LICENSE.txt: Terms of service file (English)
- LICENSE_ja.txt: Terms of service file (Japanese)
- ricoh-theta-sample-for-iosv2
- ┣ ricoh-theta-sample-for-iosv2: Sample application source
- ┣ ricoh-theta-sample-for-iosv2.xcodeproj: Sample application project
- ┗ doc: Sample application appledoc
-
-----------------------------------------
-
-* Required environment for development
-
- [About RICOH THETA S]
- Dedicated sample applications for the RICOH THETA S that meet the following conditions.
-
- * Hardware
- RICOH THETA S
- * Firmware
- Version 1.11 or higher
- (Method for checking and updating the firmware: https://theta360.com/en/support/manual/s/content/pc/pc_09.html)
-
-
- [About the Development Environment for Sample Application]
- Operation of the sample application has been verified under the following conditions.
-
- * Verified operating environment
- iPhone 5s
- * Development/Build Environment
- Xcode 7.0.1
- SDK9
-
-----------------------------------------
-
-* How to Use
-
- [Operating the Sample Application]
- 1. Open and execute ricoh-theta-sample-for-iosv2 from Xcode. The sample application is registered in the iOS device.
- 2. Connect the RICOH THETA S to the iOS device using Wi-Fi.
- (Usage instructions, connecting the camera to a smartphone: https://theta360.com/en/support/manual/s/content/prepare/prepare_06.html)
- 3. The sample application can be operated
-
- [More detailed information]
- See the contents of the provided sample program and documents, as well as documents on the Internet for further information.
-
- https://developers.theta360.com/en/docs/
-
-----------------------------------------
-
-* Latest information
-
- The latest information is released on the "RICOH THETA Developers" website.
-
- https://developers.theta360.com/
-
-----------------------------------------
-
-* Troubleshooting
-
- FAQs are available on the forums.
-
- https://developers.theta360.com/en/forums/viewforum.php?f=6
-
-----------------------------------------
-
-* Trademarks
-
- The products and services described in this document are the trademarks or registered trademarks of their respective owners.
-
- * iPhone and Xcode are trademarks of Apple Inc.
- * IOS is a registered trademark of Cisco in the USA and other countries, and is used by Apple Inc. according to the license.
- * iPhone is a registered trademark of Aiphone Co., Ltd., and is used by Apple Inc. according to the license.
- * Wi-Fi is the trademark of Wi-Fi Alliance.
-
- All other trademarks belong to their respective owners.
-
-----------------------------------------
-
-* Update History
-
- 12/22/2015 0.1.0 Initial release
+==================================================
+ README for "RICOH THETA v2 SDK for iOS"
+
+ Version :0.1.1
+==================================================
+
+This file is an explanation document for RICOH THETA v2 SDK for iOS.
+However, this document assumes that you have already registered as an iOS developer and that you are able to develop apps for iOS.
+
+----------------------------------------
+
+* Contents of this Document
+
+ * Terms of Service
+ * Files included in the archive
+ * Required environment for development
+ * How to Use
+ * Latest information
+ * Troubleshooting
+ * Trademarks
+ * Update History
+
+----------------------------------------
+
+* Terms of Service
+
+ Terms of service are included in the LICENSE.txt (LICENSE_ja.txt) file.
+ It is assumed that you have agreed to these terms of service when you start using RICOH THETA v2 SDK.
+
+----------------------------------------
+
+* Files included in the archive
+
+ README.txt: This file (English)
+ README_ja.txt: This file (Japanese)
+ LICENSE.txt: Terms of service file (English)
+ LICENSE_ja.txt: Terms of service file (Japanese)
+ ricoh-theta-sample-for-iosv2
+ ┣ ricoh-theta-sample-for-iosv2: Sample application source
+ ┣ ricoh-theta-sample-for-iosv2.xcodeproj: Sample application project
+ ┗ doc: Sample application appledoc
+
+----------------------------------------
+
+* Required environment for development
+
+ [About RICOH THETA S]
+ Dedicated sample applications for the RICOH THETA S that meet the following conditions.
+
+ * Hardware
+ RICOH THETA S
+ * Firmware
+ Version 1.11 or higher
+ (Method for checking and updating the firmware: https://theta360.com/en/support/manual/s/content/pc/pc_09.html)
+
+
+ [About the Development Environment for Sample Application]
+ Operation of the sample application has been verified under the following conditions.
+
+ * Verified operating environment
+ iPhone 5s
+ * Development/Build Environment
+ Xcode 7.0.1
+ SDK9
+
+----------------------------------------
+
+* How to Use
+
+ [Operating the Sample Application]
+ 1. Open and execute ricoh-theta-sample-for-iosv2 from Xcode. The sample application is registered in the iOS device.
+ 2. Connect the RICOH THETA S to the iOS device using Wi-Fi.
+ (Usage instructions, connecting the camera to a smartphone: https://theta360.com/en/support/manual/s/content/prepare/prepare_06.html)
+ 3. The sample application can be operated
+
+ [More detailed information]
+ See the contents of the provided sample program and documents, as well as documents on the Internet for further information.
+
+ https://developers.theta360.com/en/docs/
+
+----------------------------------------
+
+* Latest information
+
+ The latest information is released on the "RICOH THETA Developers" website.
+
+ https://developers.theta360.com/
+
+----------------------------------------
+
+* Troubleshooting
+
+ FAQs are available on the forums.
+
+ https://developers.theta360.com/en/forums/viewforum.php?f=6
+
+----------------------------------------
+
+* Trademarks
+
+ The products and services described in this document are the trademarks or registered trademarks of their respective owners.
+
+ * iPhone and Xcode are trademarks of Apple Inc.
+ * IOS is a registered trademark of Cisco in the USA and other countries, and is used by Apple Inc. according to the license.
+ * iPhone is a registered trademark of Aiphone Co., Ltd., and is used by Apple Inc. according to the license.
+ * Wi-Fi is the trademark of Wi-Fi Alliance.
+
+ All other trademarks belong to their respective owners.
+
+----------------------------------------
+
+* Update History
+
+ 12/22/2015 0.1.0 Initial release
+ 01/28/2016 0.1.1 Bug fix
diff --git a/README_ja.txt b/README_ja.txt
index eefa28c..1dbdc39 100755
--- a/README_ja.txt
+++ b/README_ja.txt
@@ -1,114 +1,115 @@
-==================================================
- README for "RICOH THETA v2 SDK for iOS"
-
- Version :0.1.0
-==================================================
-
-このファイルはRICOH THETA v2 SDK for iOSに関する説明文書です。
-なお、この文書は既にiOSの開発者登録済でiOSのアプリケーションを開発することができる状態であることを前提としています。
-
-----------------------------------------
-
-* この文書に含まれる内容
-
- * 利用規約
- * アーカイブに含まれているファイルに関して
- * 開発に必要な環境に関して
- * 使い方に関して
- * 最新の情報に関して
- * トラブルシューティング
- * 商標について
- * 更新履歴
-
-----------------------------------------
-
-* 利用規約
-
- 同梱されている、LICENSE.txt(LICENSE_ja.txt)に記載されています。
- RICOH THETA v2 SDKをご使用になられた時点で、この規約に合意したものとみなします。
-
-----------------------------------------
-
-* アーカイブに含まれているファイルに関して
-
- README.txt :このファイルです(英語)
- README_ja.txt :このファイルです(日本語)
- LICENSE.txt :規約に関するファイルです(英語)
- LICENSE_ja.txt :規約に関するファイルです(日本語)
- ricoh-theta-sample-for-iosv2
- ┣ ricoh-theta-sample-for-iosv2 :サンプルアプリケーションのソースです
- ┣ ricoh-theta-sample-for-iosv2.xcodeproj:サンプルアプリケーションのプロジェクトです
- ┗ doc :サンプルアプリケーションに関するドキュメントです
-
-----------------------------------------
-
-* 開発に必要な環境に関して
-
- [ RICOH THETA Sについて ]
- 以下の条件を満たすRICOH THETA S専用のサンプルアプリケーションです。
-
- * ハードウェア
- RICOH THETA S
- * ファームウェア
- バージョン 1.11 以上
- (ファームウェアの確認およびアップデート方法はこちらです: https://theta360.com/ja/support/manual/s/content/pc/pc_09.html )
-
-
- [ サンプルアプリケーションの開発環境について ]
- サンプルアプリケーションは以下の条件で動作確認済みです。
-
- * 動作確認環境
- iPhone 5s
- * 開発・ビルド環境
- Xcode 7.0.1
- SDK9
-
-----------------------------------------
-
-* 使い方に関して
-
- [ サンプルアプリケーションを動かす場合 ]
- 1. ricoh-theta-sample-for-iosv2をXcodeから開いて実行してください。iOS端末にサンプルアプリケーションが登録されます。
- 2. RICOH THETA SをiOS端末とWi-Fiで接続してください
- (使用説明書、カメラとスマートフォンを接続する:https://theta360.com/ja/support/manual/s/content/prepare/prepare_06.html)
- 3. サンプルアプリケーションを操作する事ができます
-
- [ より詳しい情報に関して ]
- 同梱されているサンプルアプリケーションのソースやドキュメント、およびWEB上のドキュメントをご確認ください。
-
- https://developers.theta360.com/ja/docs/
-
-----------------------------------------
-
-* 最新の情報に関して
-
- 最新の情報はWEBサイト「RICOH THETA Developers」にて公開されています。
-
- https://developers.theta360.com/
-
-----------------------------------------
-
-* トラブルシューティング
-
- よくある質問についてはこちらのフォーラム上にまとめてあります。
-
- https://developers.theta360.com/ja/forums/viewforum.php?f=5
-
-----------------------------------------
-
-* 商標について
-
- 本文書に記載されている商品・サービス名は、各社の商標または登録商標です。
-
- * iPhone、Xcodeは、Apple Inc.の商標です。
- * IOSはCiscoの米国およびその他の国の登録商標であり、Apple Inc.がライセンスに基づき使用しています。
- * iPhoneはアイホン株式会社の登録商標であり、Apple Inc.がライセンスに基づき使用しています。
- * Wi-Fiは、Wi-Fi Allianceの商標です。
-
- その他商標は全て、それぞれの所有者に帰属します。
-
-----------------------------------------
-
-* 更新履歴
-
- 2015/12/22 0.1.0 初回リリース
+==================================================
+ README for "RICOH THETA v2 SDK for iOS"
+
+ Version :0.1.1
+==================================================
+
+このファイルはRICOH THETA v2 SDK for iOSに関する説明文書です。
+なお、この文書は既にiOSの開発者登録済でiOSのアプリケーションを開発することができる状態であることを前提としています。
+
+----------------------------------------
+
+* この文書に含まれる内容
+
+ * 利用規約
+ * アーカイブに含まれているファイルに関して
+ * 開発に必要な環境に関して
+ * 使い方に関して
+ * 最新の情報に関して
+ * トラブルシューティング
+ * 商標について
+ * 更新履歴
+
+----------------------------------------
+
+* 利用規約
+
+ 同梱されている、LICENSE.txt(LICENSE_ja.txt)に記載されています。
+ RICOH THETA v2 SDKをご使用になられた時点で、この規約に合意したものとみなします。
+
+----------------------------------------
+
+* アーカイブに含まれているファイルに関して
+
+ README.txt :このファイルです(英語)
+ README_ja.txt :このファイルです(日本語)
+ LICENSE.txt :規約に関するファイルです(英語)
+ LICENSE_ja.txt :規約に関するファイルです(日本語)
+ ricoh-theta-sample-for-iosv2
+ ┣ ricoh-theta-sample-for-iosv2 :サンプルアプリケーションのソースです
+ ┣ ricoh-theta-sample-for-iosv2.xcodeproj:サンプルアプリケーションのプロジェクトです
+ ┗ doc :サンプルアプリケーションに関するドキュメントです
+
+----------------------------------------
+
+* 開発に必要な環境に関して
+
+ [ RICOH THETA Sについて ]
+ 以下の条件を満たすRICOH THETA S専用のサンプルアプリケーションです。
+
+ * ハードウェア
+ RICOH THETA S
+ * ファームウェア
+ バージョン 1.11 以上
+ (ファームウェアの確認およびアップデート方法はこちらです: https://theta360.com/ja/support/manual/s/content/pc/pc_09.html )
+
+
+ [ サンプルアプリケーションの開発環境について ]
+ サンプルアプリケーションは以下の条件で動作確認済みです。
+
+ * 動作確認環境
+ iPhone 5s
+ * 開発・ビルド環境
+ Xcode 7.0.1
+ SDK9
+
+----------------------------------------
+
+* 使い方に関して
+
+ [ サンプルアプリケーションを動かす場合 ]
+ 1. ricoh-theta-sample-for-iosv2をXcodeから開いて実行してください。iOS端末にサンプルアプリケーションが登録されます。
+ 2. RICOH THETA SをiOS端末とWi-Fiで接続してください
+ (使用説明書、カメラとスマートフォンを接続する:https://theta360.com/ja/support/manual/s/content/prepare/prepare_06.html)
+ 3. サンプルアプリケーションを操作する事ができます
+
+ [ より詳しい情報に関して ]
+ 同梱されているサンプルアプリケーションのソースやドキュメント、およびWEB上のドキュメントをご確認ください。
+
+ https://developers.theta360.com/ja/docs/
+
+----------------------------------------
+
+* 最新の情報に関して
+
+ 最新の情報はWEBサイト「RICOH THETA Developers」にて公開されています。
+
+ https://developers.theta360.com/
+
+----------------------------------------
+
+* トラブルシューティング
+
+ よくある質問についてはこちらのフォーラム上にまとめてあります。
+
+ https://developers.theta360.com/ja/forums/viewforum.php?f=5
+
+----------------------------------------
+
+* 商標について
+
+ 本文書に記載されている商品・サービス名は、各社の商標または登録商標です。
+
+ * iPhone、Xcodeは、Apple Inc.の商標です。
+ * IOSはCiscoの米国およびその他の国の登録商標であり、Apple Inc.がライセンスに基づき使用しています。
+ * iPhoneはアイホン株式会社の登録商標であり、Apple Inc.がライセンスに基づき使用しています。
+ * Wi-Fiは、Wi-Fi Allianceの商標です。
+
+ その他商標は全て、それぞれの所有者に帰属します。
+
+----------------------------------------
+
+* 更新履歴
+
+ 2015/12/22 0.1.0 初回リリース
+ 2016/01/28 0.1.1 バグ修正
diff --git a/ricoh-theta-sample-for-iosv2/doc/Classes/GLRenderView.html b/ricoh-theta-sample-for-iosv2/doc/Classes/GLRenderView.html
index c8ddde1..a823149 100755
--- a/ricoh-theta-sample-for-iosv2/doc/Classes/GLRenderView.html
+++ b/ricoh-theta-sample-for-iosv2/doc/Classes/GLRenderView.html
@@ -1,1282 +1,1282 @@
-
-
-
Images acquired from RICOH THETA S are created by equirectangular projection,
-with the images from camera #2 (left half) + camera #1 +camera#2 (right half) joined at the ends.
-These images can be acquired at a resolution of up to 5376 x 2688.
-
-
These images are pasted as texture onto a spherical object on OpenGL using UVSphere
-from this class. As this sphere is drawn at an angle from -pi to pi on the xz plane,
-the UV coordinates are generated in this orientation and attached to the image,
-and are attached so that a mirror image is not generated in the x axis direction
-when viewed from the inside of the sphere.
-
-
Furthermore, as the camera image is from angle -pi, the center of the image captured by
-camera #1 faces forward from the x axis. The camera image is slanted at the angle of elevation
-and horizontal angle, the sphere is rotated at each angle, and the image displayed in the x axis
-forward direction is adjusted to the horizontal direction of the image from camera#1.
-
-
Pinch and pan operations support zooming in, zooming out and rotating. These are supported by
-changing the camera slant and FOV angle setting value.
Images acquired from RICOH THETA S are created by equirectangular projection,
+with the images from camera #2 (left half) + camera #1 +camera#2 (right half) joined at the ends.
+These images can be acquired at a resolution of up to 5376 x 2688.
+
+
These images are pasted as texture onto a spherical object on OpenGL using UVSphere
+from this class. As this sphere is drawn at an angle from -pi to pi on the xz plane,
+the UV coordinates are generated in this orientation and attached to the image,
+and are attached so that a mirror image is not generated in the x axis direction
+when viewed from the inside of the sphere.
+
+
Furthermore, as the camera image is from angle -pi, the center of the image captured by
+camera #1 faces forward from the x axis. The camera image is slanted at the angle of elevation
+and horizontal angle, the sphere is rotated at each angle, and the image displayed in the x axis
+forward direction is adjusted to the horizontal direction of the image from camera#1.
+
+
Pinch and pan operations support zooming in, zooming out and rotating. These are supported by
+changing the camera slant and FOV angle setting value.
-If an acquisition method is called after an instance is generated, acquisition begins from the start of the list. Subsequent acquisitions begin from the token position that has been kept
-Nil is returned by the acquisition method when acquisition of the information reaches the end of the list. This value is therefore used to judge whether acquisition has reached the end.
+If an acquisition method is called after an instance is generated, acquisition begins from the start of the list. Subsequent acquisitions begin from the token position that has been kept
+Nil is returned by the acquisition method when acquisition of the information reaches the end of the list. This value is therefore used to judge whether acquisition has reached the end.
Method for UV sphere creation
-Sphere is created at the specified radius centered on the origin.
-UV sphere and corresponding texture UV coordinates are created by creating a divide/2 band
-in the longitudinal direction and dividing the band by the divide number.
Rotation angle (radian) in horizontal direction (yaw)
-
-
-
-
-
-
-
-
-
-
-
-
-
Discussion
-
Method for UV sphere creation
-Sphere is created at the specified radius centered on the origin.
-UV sphere and corresponding texture UV coordinates are created by creating a divide/2 band
-in the longitudinal direction and dividing the band by the divide number.
Method for UV sphere creation
+Sphere is created at the specified radius centered on the origin.
+UV sphere and corresponding texture UV coordinates are created by creating a divide/2 band
+in the longitudinal direction and dividing the band by the divide number.
Rotation angle (radian) in horizontal direction (yaw)
+
+
+
+
+
+
+
+
+
+
+
+
+
Discussion
+
Method for UV sphere creation
+Sphere is created at the specified radius centered on the origin.
+UV sphere and corresponding texture UV coordinates are created by creating a divide/2 band
+in the longitudinal direction and dividing the band by the divide number.
- * After shooting, the status is checked by the timer and the file information is acquired when the status indicates that the process is complete.
- * @return Information on shot media files
- */
-- (HttpImageInfo*)takePicture
-{
- // Stop live view
- [_stream cancel];
-
- // Set still image as shooting mode
- // Continue session
- [self setOptions:@{@"captureMode":@"image"}];
-
- // Semaphore for synchronization (cannot be entered until signal is called)
- dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
-
- // Create the url-request.
- NSMutableURLRequest *request = [self createExecuteRequest];
-
- // Create JSON data
- NSDictionary *body = @{@"name": @"camera.takePicture",
- @"parameters":
- @{@"sessionId": self->_sessionId}};
-
- // Set the request-body.
- [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
-
- __block NSString *commandId;
-
- // Send the url-request.
- NSURLSessionDataTask* task =
- [self->_session dataTaskWithRequest:request
- completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
- if (!error) {
- NSArray* array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
- commandId = [array valueForKey:@"id"];
- NSLog(@"commandId: %@", commandId);
- } else {
- NSLog(@"error: %@", error);
- }
- dispatch_semaphore_signal(semaphore);
- }];
- [task resume];
-
- // Wait until signal is called
- dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
-
- HttpImageInfo *resultInfo = [self waitCommandComplete:commandId];
-
- // Resume live view
- [_stream getData:_sessionId];
-
- return resultInfo;
-}
-
-/**
- * Check status of specified command and acquire information
- * @param commandId ID of command to be checked
- */
-- (HttpImageInfo*)waitCommandComplete:(NSString*)commandId
-{
- if (commandId != nil) {
- // Create timer and wait until process is completed
- NSMutableURLRequest *requestForStatus = [self createRequest:@"/osc/commands/status" method:@"POST"];
- HttpStatusTimer *timer = [[HttpStatusTimer alloc] initWithRequest:requestForStatus];
- NSString *status = [timer run:commandId];
-
- if ([status isEqualToString:@"done"]) {
- // Create the url-request.
- NSMutableURLRequest *requestForList = [self createExecuteRequest];
- HttpFileList *fileList = [[HttpFileList alloc] initWithRequest:requestForList];
-
- NSString* token;
- do {
- token = [fileList getList:1];
- HttpImageInfo *info = fileList.infoArray.firstObject;
- if ([info.file_id isEqualToString:timer.fileUri]) {
- return info;
- }
- } while ([token length] != 0);
- }
- }
- return nil;
-}
-
-/**
- * Delete specified file
- * @param info Information of file to be deleted
- * @return Delete process successful?
- */
-- (BOOL)deleteImage:(HttpImageInfo*)info
-{
- // Semaphore for synchronization (cannot be entered until signal is called)
- dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
-
- // Create the url-request.
- NSMutableURLRequest *request = [self createExecuteRequest];
-
- // Create JSON data
- NSDictionary *body = @{@"name": @"camera.delete",
- @"parameters":
- @{@"fileUri": info.file_id}};
-
- // Set the request-body.
- [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
-
- __block NSString *status;
- __block NSString *commandId = nil;
-
- // Send the url-request.
- NSURLSessionDataTask* task =
- [self->_session dataTaskWithRequest:request
- completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
- if (!error) {
- NSArray* array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
- status = [array valueForKey:@"state"];
- commandId = [array valueForKey:@"id"];
- NSLog(@"commandId: %@", commandId);
- } else {
- NSLog(@"error: %@", error);
- }
- dispatch_semaphore_signal(semaphore);
- }];
- [task resume];
-
- // Wait until signal is called
- dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
-
- if ([status isEqualToString:@"done"]) {
- return YES;
- } else if (commandId != nil) {
- // Create timer and wait until process is completed
- NSMutableURLRequest *requestForStatus = [self createRequest:@"/osc/commands/status" method:@"POST"];
- HttpStatusTimer *timer = [[HttpStatusTimer alloc] initWithRequest:requestForStatus];
- status = [timer run:commandId];
- if ([status isEqualToString:@"done"]) {
- return YES;
- }
- }
- return NO;
-}
-
-/**
- * Create HTTP request class instance for executing command
- * @return HTTP request class instance for executing command
- */
-- (NSMutableURLRequest*)createExecuteRequest
-{
- // Create the url-request.
- return [self createRequest:@"/osc/commands/execute" method:@"POST"];
-}
-
-#pragma mark - Private methods.
-
-/**
- * Send option setting request
- * @param options Dictionary in which the option name and settings were configured for the key and value
- */
-- (void)setOptions:(NSDictionary*)options
-{
- // Continue session
- [self update];
-
- // Semaphore for synchronization (cannot be entered until signal is called)
- dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
-
- // Create the url-request.
- NSMutableURLRequest *request = [self createExecuteRequest];
-
- // Create JSON data
- NSDictionary *body = @{@"name": @"camera.setOptions",
- @"parameters":
- @{@"sessionId": self->_sessionId,
- @"options":options}};
-
- // Set the request-body.
- [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
-
- // Send the url-request.
- NSURLSessionDataTask* task =
- [self->_session dataTaskWithRequest:request
- completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
- if (!error) {
- NSLog(@"result: %@", response);
- } else {
- NSLog(@"error: %@", error);
- }
- dispatch_semaphore_signal(semaphore);
- }];
- [task resume];
-
- // Wait until signal is called
- dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
-}
-
-/**
- * Create HTTP request
- * @param protocol Path
- * @param method Protocol
- * @return HTTP request instance
- */
-- (NSMutableURLRequest*)createRequest:(NSString* const)protocol method:(NSString* const)method
-{
- NSString *string = [NSString stringWithFormat:@"http://%@%@", self->_server, protocol];
- NSURL *url = [NSURL URLWithString:string];
-
- // Create the url-request.
- NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
-
- // Set the method(HTTP-POST)
- [request setHTTPMethod:method];
-
- [request setValue:@"application/json; charaset=utf-8" forHTTPHeaderField:@"Content-Type"];
-
- return request;
-}
-
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import "HttpConnection.h"
+#import "HttpStatusTimer.h"
+#import "HttpFileList.h"
+#import "HttpStream.h"
+
+/**
+ * HTTP connection to device
+ */
+@interface HttpConnection ()
+{
+ NSString *_server;
+ NSURLSession *_session;
+ NSMutableArray *_infoArray;
+ HttpStream *_stream;
+}
+@end
+
+@implementation HttpConnection
+
+#pragma mark - Accessors.
+
+/**
+ * Specify address of connection destination
+ * @param address Address
+ */
+- (void)setTargetIp:(NSString* const)address;
+{
+ _server = address;
+}
+
+/**
+ * Status of connection to device
+ * @return YES:Connect, NO:Disconnect
+ */
+- (BOOL)connected
+{
+ return (_sessionId != nil);
+}
+
+#pragma mark - Life cycle.
+
+/**
+ * Initializer
+ * @return Instance
+ */
+- (id)init
+{
+ if (self = [super init]) {
+ // Timeout settings
+ NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
+ config.timeoutIntervalForRequest = 5.0;
+
+ _session = [NSURLSession sessionWithConfiguration:config];
+ }
+ return self;
+}
+
+#pragma mark - HTTP Connections.
+
+/**
+ * Connect to device
+ * @param block Block to be called after connection process
+ */
+- (void)connect:(void(^ const)(BOOL connected))block
+{
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createExecuteRequest];
+
+ // Create JSON data
+ NSDictionary *body = @{
+ @"name":@"camera.startSession",
+ @"parameters":@""
+ };
+ NSData *json = [NSJSONSerialization dataWithJSONObject:body options:0 error:nil];
+
+ // Set the request-body.
+ [request setHTTPBody:json];
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ if (!error) {
+ NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
+ _sessionId = [array valueForKeyPath:@"results.sessionId"];
+ NSLog(@"result: %@", _sessionId);
+ } else {
+ _sessionId = nil;
+ NSLog(@"error: %@", error);
+ }
+ block(_sessionId);
+ }];
+ [task resume];
+}
+
+/**
+ * Notify device of continuation of session
+ */
+- (void)update
+{
+ if (_sessionId) {
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createExecuteRequest];
+
+ // Create JSON data
+ NSDictionary *body = @{@"name":@"camera.updateSession",
+ @"parameters":
+ @{@"sessionId":_sessionId}};
+ NSData *json = [NSJSONSerialization dataWithJSONObject:body options:0 error:nil];
+
+ // Set the request-body.
+ [request setHTTPBody:json];
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ NSString *newId = nil;
+ if (!error) {
+ NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
+ newId = [array valueForKeyPath:@"results.sessionId"];
+ NSLog(@"result: %@", newId);
+ } else {
+ NSLog(@"error: %@", error);
+ }
+
+ if (newId) {
+ _sessionId = newId;
+ } else {
+ [self connect:^(BOOL connected) {
+ _sessionId = connected ? _sessionId : [NSString string];
+ }];
+ }
+ }];
+ [task resume];
+ }
+}
+
+/**
+ * Disconnect from device
+ * @param block Block called after disconnection process
+ */
+- (void)close:(void(^ const)())block
+{
+ if (self->_sessionId) {
+ // Stop live view
+ [_stream cancel];
+
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createExecuteRequest];
+
+ // Create JSON data
+ NSDictionary *body = @{
+ @"name":@"camera.closeSession",
+ @"parameters":
+ @{ @"sessionId":self->_sessionId }
+ };
+ NSData *json = [NSJSONSerialization dataWithJSONObject:body options:0 error:nil];
+
+ // Set the request-body.
+ [request setHTTPBody:json];
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [self->_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ block();
+ }];
+ [task resume];
+ self->_sessionId = nil;
+ }
+}
+
+/**
+ * Acquire device information
+ * @param block Block to be called after acquisition process
+ */
+- (void)getDeviceInfo:(void(^const )(const HttpDeviceInfo* const info))block
+{
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createRequest:@"/osc/info" method:@"GET"];
+
+ // Do not set body for GET requests
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [self->_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ HttpDeviceInfo* info = [[HttpDeviceInfo alloc] init];
+ if (!error) {
+ NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
+ info.model = [array valueForKeyPath:@"model"];
+ info.firmware_version = [array valueForKeyPath:@"firmwareVersion"];
+ info.serial_number = [array valueForKeyPath:@"serialNumber"];
+ NSLog(@"result: %@", data);
+ } else {
+ NSLog(@"error: %@", error);
+ }
+ block(info);
+ }];
+ [task resume];
+}
+
+/**
+ * Acquire list of media files on device
+ * @return Media file list
+ */
+- (NSArray*)getImageInfoes
+{
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createExecuteRequest];
+ HttpFileList *fileList = [[HttpFileList alloc] initWithRequest:request];
+
+ NSString* token;
+ do {
+ token = [fileList getList:10];
+ } while ([token length]);
+ return fileList.infoArray;
+}
+
+/**
+ * Acquire thumbnail image
+ * @param fileId File ID
+ * @return Thumbnail
+ */
+- (NSData*)getThumb:(NSString*)fileId
+{
+ // Semaphore for synchronization (cannot be entered until signal is called)
+ dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
+
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createExecuteRequest];
+
+ // Create JSON data
+ NSDictionary *body = @{@"name": @"camera.getImage",
+ @"parameters":
+ @{@"fileUri": fileId, // ID of file to be acquired
+ @"_type": @"thumb"}}; // Type of file to be acquired
+
+ // Set the request-body.
+ [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
+
+ __block NSData *output;
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [self->_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ if (!error) {
+ output = data;
+ NSLog(@"result: %@", response);
+ } else {
+ NSLog(@"error: %@", error);
+ }
+ dispatch_semaphore_signal(semaphore);
+ }];
+ [task resume];
+
+ // Wait until signal is called
+ dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
+ return output;
+}
+
+/**
+ * Acquire storage information of device
+ * @return Storage information
+ */
+- (HttpStorageInfo*)getStorageInfo
+{
+ // Set still image as shooting mode (to acquire size set for still images)
+ // Continue session
+ [self setOptions:@{@"captureMode":@"image"}];
+
+ // Semaphore for synchronization (cannot be entered until signal is called)
+ dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
+
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createExecuteRequest];
+
+ // Create JSON data
+ NSDictionary *body = @{@"name": @"camera.getOptions",
+ @"parameters":
+ @{@"sessionId": self->_sessionId,
+ @"optionNames":
+ @[@"remainingPictures",
+ @"remainingSpace",
+ @"totalSpace",
+ @"fileFormat"]}};
+
+ // Set the request-body.
+ [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
+
+ __block HttpStorageInfo *info = [[HttpStorageInfo alloc] init];
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [self->_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ if (!error) {
+ // Acquire storage information
+ NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
+ NSArray *options = [array valueForKeyPath:@"results.options"];
+ info.free_space_in_images = [[options valueForKey:@"remainingPictures"] unsignedLongValue]; // Number of images
+ info.free_space_in_bytes = [[options valueForKey:@"remainingSpace"] unsignedLongValue]; //byte
+ info.max_capacity = [[options valueForKey:@"totalSpace"] unsignedLongValue]; //byte
+
+ // Acquire file format setting
+ NSArray *fileFormat = [options valueForKey:@"fileFormat"];
+ info.image_width = [[fileFormat valueForKey:@"width"] unsignedLongValue];
+ info.image_height = [[fileFormat valueForKey:@"height"] unsignedLongValue];
+ NSLog(@"result: %@", info);
+ } else {
+ NSLog(@"error: %@", error);
+ }
+ dispatch_semaphore_signal(semaphore);
+ }];
+ [task resume];
+
+ // Wait until signal is called
+ dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
+ return info;
+}
+
+/**
+ * Acquire battery information of device
+ * @return Battery level (4 levels: 0.0, 0.33, 0.67 and 1.0)
+ */
+-(NSNumber*)getBatteryLevel
+{
+ // Semaphore for synchronization (cannot be entered until signal is called)
+ dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
+
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createRequest:@"/osc/state" method:@"POST"];
+
+ __block NSNumber *batteryLevel;
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [self->_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ if (!error) {
+ NSArray* array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
+ NSArray* state = [array valueForKey:@"state"];
+ batteryLevel = [state valueForKey:@"batteryLevel"];
+ NSLog(@"result: %@", batteryLevel);
+ } else {
+ NSLog(@"error: %@", error);
+ }
+ dispatch_semaphore_signal(semaphore);
+ }];
+ [task resume];
+
+ // Wait until signal is called
+ dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
+ return batteryLevel;
+}
+
+/**
+ * Specify shooting size
+ * @param width Width of shot image
+ * @param height Height of shot image
+ */
+- (void)setImageFormat:(NSUInteger)width height:(NSUInteger)height
+{
+ [self setOptions:@{@"captureMode": @"image"}];
+ [self setOptions:@{@"fileFormat":
+ @{@"type": @"jpeg",
+ @"width": [NSNumber numberWithUnsignedInteger:width],
+ @"height": [NSNumber numberWithUnsignedInteger:height]}}];
+}
+
+/**
+ * Start live view
+ * @param block Block called on drawing. Used to perform the drawing process of the image.
+ */
+- (void)startLiveView:(void(^ const)(NSData *frameData))block
+{
+ // Continue session
+ [self update];
+
+ if ([self connected]) {
+ NSMutableURLRequest *request = [self createExecuteRequest];
+ _stream = [[HttpStream alloc] initWithRequest:request];
+ [_stream setDelegate:block];
+ [_stream getData:_sessionId];
+ }
+}
+
+/**
+ * Resume live view
+ */
+- (void)restartLiveView
+{
+ if ([self connected]) {
+ // Continue session
+ [self update];
+
+ [_stream getData:_sessionId];
+ }
+}
+
+/**
+ * Take photo
+ * After shooting, the status is checked by the timer and the file information is acquired when the status indicates that the process is complete.
+ * @return Information on shot media files
+ */
+- (HttpImageInfo*)takePicture
+{
+ // Stop live view
+ [_stream cancel];
+
+ // Set still image as shooting mode
+ // Continue session
+ [self setOptions:@{@"captureMode":@"image"}];
+
+ // Semaphore for synchronization (cannot be entered until signal is called)
+ dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
+
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createExecuteRequest];
+
+ // Create JSON data
+ NSDictionary *body = @{@"name": @"camera.takePicture",
+ @"parameters":
+ @{@"sessionId": self->_sessionId}};
+
+ // Set the request-body.
+ [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
+
+ __block NSString *commandId;
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [self->_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ if (!error) {
+ NSArray* array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
+ commandId = [array valueForKey:@"id"];
+ NSLog(@"commandId: %@", commandId);
+ } else {
+ NSLog(@"error: %@", error);
+ }
+ dispatch_semaphore_signal(semaphore);
+ }];
+ [task resume];
+
+ // Wait until signal is called
+ dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
+
+ HttpImageInfo *resultInfo = [self waitCommandComplete:commandId];
+
+ // Resume live view
+ [_stream getData:_sessionId];
+
+ return resultInfo;
+}
+
+/**
+ * Check status of specified command and acquire information
+ * @param commandId ID of command to be checked
+ */
+- (HttpImageInfo*)waitCommandComplete:(NSString*)commandId
+{
+ if (commandId != nil) {
+ // Create timer and wait until process is completed
+ NSMutableURLRequest *requestForStatus = [self createRequest:@"/osc/commands/status" method:@"POST"];
+ HttpStatusTimer *timer = [[HttpStatusTimer alloc] initWithRequest:requestForStatus];
+ NSString *status = [timer run:commandId];
+
+ if ([status isEqualToString:@"done"]) {
+ // Create the url-request.
+ NSMutableURLRequest *requestForList = [self createExecuteRequest];
+ HttpFileList *fileList = [[HttpFileList alloc] initWithRequest:requestForList];
+
+ NSString* token;
+ do {
+ token = [fileList getList:1];
+ HttpImageInfo *info = fileList.infoArray.firstObject;
+ if ([info.file_id isEqualToString:timer.fileUri]) {
+ return info;
+ }
+ } while ([token length] != 0);
+ }
+ }
+ return nil;
+}
+
+/**
+ * Delete specified file
+ * @param info Information of file to be deleted
+ * @return Delete process successful?
+ */
+- (BOOL)deleteImage:(HttpImageInfo*)info
+{
+ // Semaphore for synchronization (cannot be entered until signal is called)
+ dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
+
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createExecuteRequest];
+
+ // Create JSON data
+ NSDictionary *body = @{@"name": @"camera.delete",
+ @"parameters":
+ @{@"fileUri": info.file_id}};
+
+ // Set the request-body.
+ [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
+
+ __block NSString *status;
+ __block NSString *commandId = nil;
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [self->_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ if (!error) {
+ NSArray* array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
+ status = [array valueForKey:@"state"];
+ commandId = [array valueForKey:@"id"];
+ NSLog(@"commandId: %@", commandId);
+ } else {
+ NSLog(@"error: %@", error);
+ }
+ dispatch_semaphore_signal(semaphore);
+ }];
+ [task resume];
+
+ // Wait until signal is called
+ dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
+
+ if ([status isEqualToString:@"done"]) {
+ return YES;
+ } else if (commandId != nil) {
+ // Create timer and wait until process is completed
+ NSMutableURLRequest *requestForStatus = [self createRequest:@"/osc/commands/status" method:@"POST"];
+ HttpStatusTimer *timer = [[HttpStatusTimer alloc] initWithRequest:requestForStatus];
+ status = [timer run:commandId];
+ if ([status isEqualToString:@"done"]) {
+ return YES;
+ }
+ }
+ return NO;
+}
+
+/**
+ * Create HTTP request class instance for executing command
+ * @return HTTP request class instance for executing command
+ */
+- (NSMutableURLRequest*)createExecuteRequest
+{
+ // Create the url-request.
+ return [self createRequest:@"/osc/commands/execute" method:@"POST"];
+}
+
+#pragma mark - Private methods.
+
+/**
+ * Send option setting request
+ * @param options Dictionary in which the option name and settings were configured for the key and value
+ */
+- (void)setOptions:(NSDictionary*)options
+{
+ // Continue session
+ [self update];
+
+ // Semaphore for synchronization (cannot be entered until signal is called)
+ dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
+
+ // Create the url-request.
+ NSMutableURLRequest *request = [self createExecuteRequest];
+
+ // Create JSON data
+ NSDictionary *body = @{@"name": @"camera.setOptions",
+ @"parameters":
+ @{@"sessionId": self->_sessionId,
+ @"options":options}};
+
+ // Set the request-body.
+ [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [self->_session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ if (!error) {
+ NSLog(@"result: %@", response);
+ } else {
+ NSLog(@"error: %@", error);
+ }
+ dispatch_semaphore_signal(semaphore);
+ }];
+ [task resume];
+
+ // Wait until signal is called
+ dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
+}
+
+/**
+ * Create HTTP request
+ * @param protocol Path
+ * @param method Protocol
+ * @return HTTP request instance
+ */
+- (NSMutableURLRequest*)createRequest:(NSString* const)protocol method:(NSString* const)method
+{
+ NSString *string = [NSString stringWithFormat:@"http://%@%@", self->_server, protocol];
+ NSURL *url = [NSURL URLWithString:string];
+
+ // Create the url-request.
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+
+ // Set the method(HTTP-POST)
+ [request setHTTPMethod:method];
+
+ [request setValue:@"application/json; charaset=utf-8" forHTTPHeaderField:@"Content-Type"];
+
+ return request;
+}
+
@end
\ No newline at end of file
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpDeviceInfo.h b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpDeviceInfo.h
index c209a91..7bf59b3 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpDeviceInfo.h
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpDeviceInfo.h
@@ -1,30 +1,30 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import
-
-/**
- * Device information class
- */
-@interface HttpDeviceInfo : NSObject
-
-/**
- * Model name
- */
-@property (nonatomic) NSString* model;
-/**
- * Firmware version
- */
-@property (nonatomic) NSString* firmware_version;
-/**
- * Serial number
- */
-@property (nonatomic) NSString* serial_number;
-
-/**
- * Device information represented as character string
- */
-- (NSString*)description;
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import
+
+/**
+ * Device information class
+ */
+@interface HttpDeviceInfo : NSObject
+
+/**
+ * Model name
+ */
+@property (nonatomic) NSString* model;
+/**
+ * Firmware version
+ */
+@property (nonatomic) NSString* firmware_version;
+/**
+ * Serial number
+ */
+@property (nonatomic) NSString* serial_number;
+
+/**
+ * Device information represented as character string
+ */
+- (NSString*)description;
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpDeviceInfo.m b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpDeviceInfo.m
index 069b6f6..b2624e0 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpDeviceInfo.m
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpDeviceInfo.m
@@ -1,18 +1,18 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import "HttpDeviceInfo.h"
-
-@implementation HttpDeviceInfo
-
-- (NSString*)description
-{
- NSMutableString* string = [NSMutableString string];
- [string appendFormat:@" model=%@", self->_model];
- [string appendFormat:@" firmware_version=%@", self->_firmware_version];
- [string appendFormat:@" serial_number=%@", self->_serial_number];
- return string;
-}
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import "HttpDeviceInfo.h"
+
+@implementation HttpDeviceInfo
+
+- (NSString*)description
+{
+ NSMutableString* string = [NSMutableString string];
+ [string appendFormat:@" model=%@", self->_model];
+ [string appendFormat:@" firmware_version=%@", self->_firmware_version];
+ [string appendFormat:@" serial_number=%@", self->_serial_number];
+ return string;
+}
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpFileList.h b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpFileList.h
index 17a4944..7c82fa1 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpFileList.h
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpFileList.h
@@ -1,15 +1,15 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import
-
-@interface HttpFileList : NSObject
-
-@property (readonly) NSMutableArray *infoArray;
-
-- (id)initWithRequest:(NSMutableURLRequest*)request;
-
-- (NSString*)getList:(NSUInteger)numItems;
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import
+
+@interface HttpFileList : NSObject
+
+@property (readonly) NSMutableArray *infoArray;
+
+- (id)initWithRequest:(NSMutableURLRequest*)request;
+
+- (NSString*)getList:(NSUInteger)numItems;
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpFileList.m b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpFileList.m
index f7e83c3..9c31e7d 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpFileList.m
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpFileList.m
@@ -1,110 +1,110 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import "HttpFileList.h"
-#import "HttpImageInfo.h"
-
-/**
- * Acquisition class of media file information
- * If an acquisition method is called after an instance is generated, acquisition begins from the start of the list. Subsequent acquisitions begin from the token position that has been kept
- * Nil is returned by the acquisition method when acquisition of the information reaches the end of the list. This value is therefore used to judge whether acquisition has reached the end.
- */
-@interface HttpFileList()
-{
- NSString *_currentToken;
- NSMutableURLRequest *_request;
- NSURLSession *_session;
-}
-@end
-
-@implementation HttpFileList
-
-/**
- * Specified initializer
- * @param request HTTP request
- * @return Instance
- */
-- (id)initWithRequest:(NSMutableURLRequest*)request
-{
- if ([super init]) {
- _currentToken = @"";
- _request = request;
-
- // Create and keep HTTP session
- NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
- _session= [NSURLSession sessionWithConfiguration:config];
-
- _infoArray = nil;
- }
- return self;
-}
-
-/**
- * Acquire information on multiple files together
- * @param numItems Number of files for which to acquire information
- * @return Newly acquired token. Nil returned when acquisition reaches end of list
- */
-- (NSString*)getList:(NSUInteger)numItems
-{
- // Generate NSMutableArray first time only
- if (_infoArray == nil) {
- _infoArray = [NSMutableArray arrayWithCapacity:numItems];
- }
-
- // Semaphore for synchronization
- dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
-
- // Create JSON data
- NSDictionary *body = @{@"name": @"camera._listAll",
- @"parameters":
- @{@"entryCount":[NSNumber numberWithUnsignedInteger:numItems], // Number of still image and video files to be acquired
- @"continuationToken": _currentToken, // Token for resuming loading from previous _listAll
- @"detail": @YES} // Acquire file details?
- };
- NSData *json = [NSJSONSerialization dataWithJSONObject:body options:0 error:nil];
-
- // Set the request-body.
- [_request setHTTPBody:json];
-
- // Send the url-request.
- NSURLSessionDataTask* task =
- [_session dataTaskWithRequest:_request
- completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
- if (!error) {
- NSArray* array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
- NSArray* results = [array valueForKey:@"results"];
- NSArray* entries = [results valueForKey:@"entries"];
- _currentToken = [results valueForKey:@"continuationToken"];
-
- NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
- [formatter setDateFormat:@"yyyy:MM:dd HH:mm:ssZ"];
-
- // Repeat for each acquired object
- NSUInteger entriesCount = [entries count];
- for (int i = 0; i < entriesCount; i++) {
- NSArray* entry = [entries objectAtIndex:i];
- HttpImageInfo* info = [[HttpImageInfo alloc] init];
- info.file_name = [entry valueForKey:@"name"];
- info.file_id = [entry valueForKey:@"uri"];
- info.file_size = [[entry valueForKey:@"size"] longValue]; // File size (bytes)
- info.capture_date = [formatter dateFromString:[entry valueForKey:@"dateTimeZone"]];
- info.image_pix_width = [[entry valueForKey:@"width"] longValue];
- info.image_pix_height = [[entry valueForKey:@"height"] longValue];
- info.file_format = [entry valueForKey:@"recordTime"] ? CODE_MPEG : CODE_JPEG;
- [self->_infoArray addObject:info];
- }
- NSLog(@"result: %@", entries);
- } else {
- NSLog(@"error: %@", error);
- }
- dispatch_semaphore_signal(semaphore);
- }];
- [task resume];
-
- // Wait until finished using semaphore
- dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
- return _currentToken;
-}
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import "HttpFileList.h"
+#import "HttpImageInfo.h"
+
+/**
+ * Acquisition class of media file information
+ * If an acquisition method is called after an instance is generated, acquisition begins from the start of the list. Subsequent acquisitions begin from the token position that has been kept
+ * Nil is returned by the acquisition method when acquisition of the information reaches the end of the list. This value is therefore used to judge whether acquisition has reached the end.
+ */
+@interface HttpFileList()
+{
+ NSString *_currentToken;
+ NSMutableURLRequest *_request;
+ NSURLSession *_session;
+}
+@end
+
+@implementation HttpFileList
+
+/**
+ * Specified initializer
+ * @param request HTTP request
+ * @return Instance
+ */
+- (id)initWithRequest:(NSMutableURLRequest*)request
+{
+ if ([super init]) {
+ _currentToken = @"";
+ _request = request;
+
+ // Create and keep HTTP session
+ NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
+ _session= [NSURLSession sessionWithConfiguration:config];
+
+ _infoArray = nil;
+ }
+ return self;
+}
+
+/**
+ * Acquire information on multiple files together
+ * @param numItems Number of files for which to acquire information
+ * @return Newly acquired token. Nil returned when acquisition reaches end of list
+ */
+- (NSString*)getList:(NSUInteger)numItems
+{
+ // Generate NSMutableArray first time only
+ if (_infoArray == nil) {
+ _infoArray = [NSMutableArray arrayWithCapacity:numItems];
+ }
+
+ // Semaphore for synchronization
+ dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
+
+ // Create JSON data
+ NSDictionary *body = @{@"name": @"camera._listAll",
+ @"parameters":
+ @{@"entryCount":[NSNumber numberWithUnsignedInteger:numItems], // Number of still image and video files to be acquired
+ @"continuationToken": _currentToken, // Token for resuming loading from previous _listAll
+ @"detail": @YES} // Acquire file details?
+ };
+ NSData *json = [NSJSONSerialization dataWithJSONObject:body options:0 error:nil];
+
+ // Set the request-body.
+ [_request setHTTPBody:json];
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [_session dataTaskWithRequest:_request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ if (!error) {
+ NSArray* array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
+ NSArray* results = [array valueForKey:@"results"];
+ NSArray* entries = [results valueForKey:@"entries"];
+ _currentToken = [results valueForKey:@"continuationToken"];
+
+ NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+ [formatter setDateFormat:@"yyyy:MM:dd HH:mm:ssZ"];
+
+ // Repeat for each acquired object
+ NSUInteger entriesCount = [entries count];
+ for (int i = 0; i < entriesCount; i++) {
+ NSArray* entry = [entries objectAtIndex:i];
+ HttpImageInfo* info = [[HttpImageInfo alloc] init];
+ info.file_name = [entry valueForKey:@"name"];
+ info.file_id = [entry valueForKey:@"uri"];
+ info.file_size = [[entry valueForKey:@"size"] longValue]; // File size (bytes)
+ info.capture_date = [formatter dateFromString:[entry valueForKey:@"dateTimeZone"]];
+ info.image_pix_width = [[entry valueForKey:@"width"] longValue];
+ info.image_pix_height = [[entry valueForKey:@"height"] longValue];
+ info.file_format = [entry valueForKey:@"recordTime"] ? CODE_MPEG : CODE_JPEG;
+ [self->_infoArray addObject:info];
+ }
+ NSLog(@"result: %@", entries);
+ } else {
+ NSLog(@"error: %@", error);
+ }
+ dispatch_semaphore_signal(semaphore);
+ }];
+ [task resume];
+
+ // Wait until finished using semaphore
+ dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
+ return _currentToken;
+}
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpImageInfo.h b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpImageInfo.h
index 9f5fd18..03288f8 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpImageInfo.h
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpImageInfo.h
@@ -1,49 +1,49 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import
-
-/**
- * Media format type
- */
-enum IMAGE_FORMAT : NSInteger {
- CODE_JPEG,
- CODE_MPEG,
-};
-
-/**
- * Information class of media file
- */
-@interface HttpImageInfo : NSObject
-
-/**
- * Media format
- */
-@property (nonatomic) enum IMAGE_FORMAT file_format;
-/**
- * File size
- */
-@property (nonatomic) NSUInteger file_size;
-/**
- * Image width
- */
-@property (nonatomic) NSUInteger image_pix_width;
-/**
- * Image height
- */
-@property (nonatomic) NSUInteger image_pix_height;
-/**
- * File name
- */
-@property (nonatomic) NSString* file_name;
-/**
- * File creation/update time
- */
-@property (nonatomic) NSDate* capture_date;
-/**
- * File ID
- */
-@property (nonatomic) NSString* file_id;
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import
+
+/**
+ * Media format type
+ */
+enum IMAGE_FORMAT : NSInteger {
+ CODE_JPEG,
+ CODE_MPEG,
+};
+
+/**
+ * Information class of media file
+ */
+@interface HttpImageInfo : NSObject
+
+/**
+ * Media format
+ */
+@property (nonatomic) enum IMAGE_FORMAT file_format;
+/**
+ * File size
+ */
+@property (nonatomic) NSUInteger file_size;
+/**
+ * Image width
+ */
+@property (nonatomic) NSUInteger image_pix_width;
+/**
+ * Image height
+ */
+@property (nonatomic) NSUInteger image_pix_height;
+/**
+ * File name
+ */
+@property (nonatomic) NSString* file_name;
+/**
+ * File creation/update time
+ */
+@property (nonatomic) NSDate* capture_date;
+/**
+ * File ID
+ */
+@property (nonatomic) NSString* file_id;
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpImageInfo.m b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpImageInfo.m
index 3d9614f..c3deb4d 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpImageInfo.m
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpImageInfo.m
@@ -1,23 +1,23 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import "HttpImageInfo.h"
-
-@implementation HttpImageInfo
-
--(NSString*)description
-{
- NSMutableString* s = [NSMutableString stringWithString:@""];
- return s;
-}
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import "HttpImageInfo.h"
+
+@implementation HttpImageInfo
+
+-(NSString*)description
+{
+ NSMutableString* s = [NSMutableString stringWithString:@""];
+ return s;
+}
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpSession.h b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpSession.h
index 0e73942..9a62120 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpSession.h
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpSession.h
@@ -1,19 +1,19 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import
-
-/**
- * Class for downloading files via HTTP
- */
-@interface HttpSession : NSObject
-
-- (id)initWithRequest:(NSMutableURLRequest*)request;
-
-- (void)getResizedImageObject:(NSString*)fileUri
- onStart:(void(^)(int64_t expectedTotalBytes))startBlock
- onWrite:(void(^)(int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))writeBlock
- onFinish:(void(^)(NSURL *location))finishBlock;
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import
+
+/**
+ * Class for downloading files via HTTP
+ */
+@interface HttpSession : NSObject
+
+- (id)initWithRequest:(NSMutableURLRequest*)request;
+
+- (void)getResizedImageObject:(NSString*)fileUri
+ onStart:(void(^)(int64_t expectedTotalBytes))startBlock
+ onWrite:(void(^)(int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))writeBlock
+ onFinish:(void(^)(NSURL *location))finishBlock;
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpSession.m b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpSession.m
index 02160d4..509e24c 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpSession.m
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpSession.m
@@ -1,105 +1,105 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import "HttpSession.h"
-
-/**
- * File download class
- */
-@interface HttpSession()
-{
- NSMutableURLRequest* _request;
- NSURLSession *_session;
- void (^onStart)(int64_t expectedTotalBytes);
- void (^onWrite)(int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
- void (^onFinish)(NSURL *location);
-}
-@end
-
-@implementation HttpSession
-
-/**
- * Specified initializer
- * @param request HTTP request
- * @return Instance
- */
-- (id)initWithRequest:(NSMutableURLRequest*)request
-{
- if (self = [super init]) {
- self->_request = request;
- }
- return self;
-}
-
-/**
- * Download file with specified file ID
- * @param fileUri ID of file to be downloaded
- * @param startBlock Block to be called on start of download
- * @param writeBlock Blocks to be called successively during download
- * @param finishBlock Block to be called at end of download
- */
-- (void)getResizedImageObject:(NSString*)fileUri
- onStart:(void(^)(int64_t expectedTotalBytes))startBlock
- onWrite:(void(^)(int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))writeBlock
- onFinish:(void(^)(NSURL *location))finishBlock
-{
- self->onStart = startBlock;
- self->onWrite = writeBlock;
- self->onFinish = finishBlock;
-
- // Create JSON data
- NSDictionary *body = @{@"name": @"camera.getImage",
- @"parameters":
- @{@"fileUri": fileUri, // ID of file to be acquired
- @"_type": @"full"}}; // Type of file to be acquired
-
- // Set the request-body.
- [self->_request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
-
- NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
- _session = [NSURLSession sessionWithConfiguration:config
- delegate:self
- delegateQueue:[NSOperationQueue mainQueue]];
-
- // Download data as file
- NSURLSessionDownloadTask* task = [_session downloadTaskWithRequest:self->_request];
- [task resume];
-}
-
-/**
- * Delegate to be called on start of download
- * @param session Session
- * @param downloadTask Task
- * @param fileOffset Acquired byte count on disk
- * @param expectedTotalBytes Predicted byte count of entire acquired file
- */
-- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes
-{
- self->onStart(expectedTotalBytes);
-}
-
-/**
- * Delegates to be called successively during download
- * @param session Session
- * @param downloadTask Task
- * @param bytesWritten Byte count transferred each time a delegate method is called
- * @param totalBytesWritten Current total transferred byte count
- * @param totalBytesExpectedToWrite Predicted byte count of acquired file
- */
-- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
-{
- self->onWrite(totalBytesWritten, totalBytesExpectedToWrite);
-}
-
-/**
- * Delegate to be called at end of download
- * @param session Session
- * @param downloadTask Task
- * @param location File URL of acquired temporary file
- */
-- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location
-{
- self->onFinish(location);
-}
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import "HttpSession.h"
+
+/**
+ * File download class
+ */
+@interface HttpSession()
+{
+ NSMutableURLRequest* _request;
+ NSURLSession *_session;
+ void (^onStart)(int64_t expectedTotalBytes);
+ void (^onWrite)(int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
+ void (^onFinish)(NSURL *location);
+}
+@end
+
+@implementation HttpSession
+
+/**
+ * Specified initializer
+ * @param request HTTP request
+ * @return Instance
+ */
+- (id)initWithRequest:(NSMutableURLRequest*)request
+{
+ if (self = [super init]) {
+ self->_request = request;
+ }
+ return self;
+}
+
+/**
+ * Download file with specified file ID
+ * @param fileUri ID of file to be downloaded
+ * @param startBlock Block to be called on start of download
+ * @param writeBlock Blocks to be called successively during download
+ * @param finishBlock Block to be called at end of download
+ */
+- (void)getResizedImageObject:(NSString*)fileUri
+ onStart:(void(^)(int64_t expectedTotalBytes))startBlock
+ onWrite:(void(^)(int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))writeBlock
+ onFinish:(void(^)(NSURL *location))finishBlock
+{
+ self->onStart = startBlock;
+ self->onWrite = writeBlock;
+ self->onFinish = finishBlock;
+
+ // Create JSON data
+ NSDictionary *body = @{@"name": @"camera.getImage",
+ @"parameters":
+ @{@"fileUri": fileUri, // ID of file to be acquired
+ @"_type": @"full"}}; // Type of file to be acquired
+
+ // Set the request-body.
+ [self->_request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
+
+ NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
+ _session = [NSURLSession sessionWithConfiguration:config
+ delegate:self
+ delegateQueue:[NSOperationQueue mainQueue]];
+
+ // Download data as file
+ NSURLSessionDownloadTask* task = [_session downloadTaskWithRequest:self->_request];
+ [task resume];
+}
+
+/**
+ * Delegate to be called on start of download
+ * @param session Session
+ * @param downloadTask Task
+ * @param fileOffset Acquired byte count on disk
+ * @param expectedTotalBytes Predicted byte count of entire acquired file
+ */
+- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes
+{
+ self->onStart(expectedTotalBytes);
+}
+
+/**
+ * Delegates to be called successively during download
+ * @param session Session
+ * @param downloadTask Task
+ * @param bytesWritten Byte count transferred each time a delegate method is called
+ * @param totalBytesWritten Current total transferred byte count
+ * @param totalBytesExpectedToWrite Predicted byte count of acquired file
+ */
+- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
+{
+ self->onWrite(totalBytesWritten, totalBytesExpectedToWrite);
+}
+
+/**
+ * Delegate to be called at end of download
+ * @param session Session
+ * @param downloadTask Task
+ * @param location File URL of acquired temporary file
+ */
+- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location
+{
+ self->onFinish(location);
+}
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStatusTimer.h b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStatusTimer.h
index a3d1c66..165495f 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStatusTimer.h
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStatusTimer.h
@@ -1,15 +1,15 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import
-
-@interface HttpStatusTimer : NSObject
-
-@property (readonly) NSString* fileUri;
-
-- (id)initWithRequest:(NSMutableURLRequest*)request;
-
-- (NSString*)run:(NSString*)command;
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import
+
+@interface HttpStatusTimer : NSObject
+
+@property (readonly) NSString* fileUri;
+
+- (id)initWithRequest:(NSMutableURLRequest*)request;
+
+- (NSString*)run:(NSString*)command;
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStatusTimer.m b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStatusTimer.m
index 8c32c04..fec04ff 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStatusTimer.m
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStatusTimer.m
@@ -1,100 +1,100 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import "HttpStatusTimer.h"
-
-/**
- * Class for periodic monitoring of command status
- */
-@interface HttpStatusTimer()
-{
- NSMutableURLRequest *_request;
- NSURLSession* _session;
- NSString *_commandId;
- dispatch_semaphore_t _semaphore;
- NSString *_state;
-}
-@end
-
-@implementation HttpStatusTimer
-
-/**
- * Specified initializer
- * @param request HTTP request
- * @return Instance
- */
-- (id)initWithRequest:(NSMutableURLRequest*)request
-{
- if ([super init]) {
- _request = request;
- }
- return self;
-}
-
-/**
- * Start status monitoring
- * @param command ID of command to be monitored
- * @return Status indicating completion or error
- */
-- (NSString*)run:(NSString*)command
-{
- // Create and keep HTTP session
- NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
- _session= [NSURLSession sessionWithConfiguration:config];
-
- _commandId = command;
-
- // Semaphore for synchronization (cannot be entered until signal is called)
- _semaphore = dispatch_semaphore_create(0);
-
- // Create and start timer
- NSTimer *timer = [NSTimer timerWithTimeInterval:0.5f
- target:self
- selector:@selector(getState:)
- userInfo:nil
- repeats:YES];
- NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
- [runLoop addTimer:timer forMode:NSRunLoopCommonModes];
- [runLoop run];
-
- // Wait until signal is called
- dispatch_semaphore_wait(_semaphore, DISPATCH_TIME_FOREVER);
- return _state;
-}
-
-/**
- * Delegate called during each set period of time
- * @param timer Timer
- */
-- (void)getState:(NSTimer*)timer
-{
- // Create JSON data
- NSDictionary *body = @{@"id": _commandId};
-
- // Set the request-body.
- [_request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
-
- // Send the url-request.
- NSURLSessionDataTask* task =
- [_session dataTaskWithRequest:_request
- completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
- if (!error) {
- NSArray* array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
- _state = [array valueForKey:@"state"];
- _fileUri = [array valueForKeyPath:@"results.fileUri"];
- NSLog(@"result: %@", _state);
- } else {
- _state = @"error";
- NSLog(@"GetStorageInfo: received data is invalid.");
- }
- if (![_state isEqualToString:@"inProgress"]) {
- dispatch_semaphore_signal(_semaphore);
-
- // Stop timer
- [timer invalidate];
- }
- }];
- [task resume];
-}
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import "HttpStatusTimer.h"
+
+/**
+ * Class for periodic monitoring of command status
+ */
+@interface HttpStatusTimer()
+{
+ NSMutableURLRequest *_request;
+ NSURLSession* _session;
+ NSString *_commandId;
+ dispatch_semaphore_t _semaphore;
+ NSString *_state;
+}
+@end
+
+@implementation HttpStatusTimer
+
+/**
+ * Specified initializer
+ * @param request HTTP request
+ * @return Instance
+ */
+- (id)initWithRequest:(NSMutableURLRequest*)request
+{
+ if ([super init]) {
+ _request = request;
+ }
+ return self;
+}
+
+/**
+ * Start status monitoring
+ * @param command ID of command to be monitored
+ * @return Status indicating completion or error
+ */
+- (NSString*)run:(NSString*)command
+{
+ // Create and keep HTTP session
+ NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
+ _session= [NSURLSession sessionWithConfiguration:config];
+
+ _commandId = command;
+
+ // Semaphore for synchronization (cannot be entered until signal is called)
+ _semaphore = dispatch_semaphore_create(0);
+
+ // Create and start timer
+ NSTimer *timer = [NSTimer timerWithTimeInterval:0.5f
+ target:self
+ selector:@selector(getState:)
+ userInfo:nil
+ repeats:YES];
+ NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
+ [runLoop addTimer:timer forMode:NSRunLoopCommonModes];
+ [runLoop run];
+
+ // Wait until signal is called
+ dispatch_semaphore_wait(_semaphore, DISPATCH_TIME_FOREVER);
+ return _state;
+}
+
+/**
+ * Delegate called during each set period of time
+ * @param timer Timer
+ */
+- (void)getState:(NSTimer*)timer
+{
+ // Create JSON data
+ NSDictionary *body = @{@"id": _commandId};
+
+ // Set the request-body.
+ [_request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
+
+ // Send the url-request.
+ NSURLSessionDataTask* task =
+ [_session dataTaskWithRequest:_request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+ if (!error) {
+ NSArray* array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
+ _state = [array valueForKey:@"state"];
+ _fileUri = [array valueForKeyPath:@"results.fileUri"];
+ NSLog(@"result: %@", _state);
+ } else {
+ _state = @"error";
+ NSLog(@"GetStorageInfo: received data is invalid.");
+ }
+ if (![_state isEqualToString:@"inProgress"]) {
+ dispatch_semaphore_signal(_semaphore);
+
+ // Stop timer
+ [timer invalidate];
+ }
+ }];
+ [task resume];
+}
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStorageInfo.h b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStorageInfo.h
index a0dd175..e53169c 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStorageInfo.h
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStorageInfo.h
@@ -1,33 +1,33 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import
-
-/**
- * Device storage information and size of shot image
- */
-@interface HttpStorageInfo : NSObject
-
-/**
- * Total storage capacity
- */
-@property (nonatomic) unsigned long max_capacity;
-/**
- * Remaining capacity
- */
-@property (nonatomic) unsigned long free_space_in_bytes;
-/**
- * Remaining number of photos
- */
-@property (nonatomic) unsigned long free_space_in_images;
-/**
- * Image width for shooting still images
- */
-@property (nonatomic) unsigned long image_width;
-/**
- * Image height for shooting still images
- */
-@property (nonatomic) unsigned long image_height;
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import
+
+/**
+ * Device storage information and size of shot image
+ */
+@interface HttpStorageInfo : NSObject
+
+/**
+ * Total storage capacity
+ */
+@property (nonatomic) unsigned long max_capacity;
+/**
+ * Remaining capacity
+ */
+@property (nonatomic) unsigned long free_space_in_bytes;
+/**
+ * Remaining number of photos
+ */
+@property (nonatomic) unsigned long free_space_in_images;
+/**
+ * Image width for shooting still images
+ */
+@property (nonatomic) unsigned long image_width;
+/**
+ * Image height for shooting still images
+ */
+@property (nonatomic) unsigned long image_height;
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStorageInfo.m b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStorageInfo.m
index d83ebfc..4d4ac52 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStorageInfo.m
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStorageInfo.m
@@ -1,9 +1,9 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import "HttpStorageInfo.h"
-
-@implementation HttpStorageInfo
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import "HttpStorageInfo.h"
+
+@implementation HttpStorageInfo
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStream.h b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStream.h
index 3f866ab..6d88d7d 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStream.h
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStream.h
@@ -1,17 +1,17 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import
-
-@interface HttpStream : NSObject
-
-- (void)setDelegate:(void(^)(NSData *frameData))bufferBlock;
-
-- (id)initWithRequest:(NSMutableURLRequest*)request;
-
-- (void)getData:(NSString*)sessionId;
-
-- (void)cancel;
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import
+
+@interface HttpStream : NSObject
+
+- (void)setDelegate:(void(^)(NSData *frameData))bufferBlock;
+
+- (id)initWithRequest:(NSMutableURLRequest*)request;
+
+- (void)getData:(NSString*)sessionId;
+
+- (void)cancel;
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStream.m b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStream.m
index fe8f446..de85df8 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStream.m
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/http/HttpStream.m
@@ -1,161 +1,161 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import "HttpStream.h"
-
-// Start and end markers for images in JPEG format
-const Byte SOI_MARKER[] = {0xFF, 0xD8};
-const Byte EOI_MARKER[] = {0xFF, 0xD9};
-
-/**
- * Live view data acquisition class
- */
-@interface HttpStream()
-{
- NSMutableURLRequest *_request;
- NSMutableData *_buffer;
- NSMutableArray *_frameArray;
- NSURLSessionDataTask *_task;
- void (^_onBuffered)(NSData *frameData);
- BOOL _isContinue;
-}
-@end
-
-@implementation HttpStream
-
-/**
- * Set block to be executed when receiving data
- * @param bufferBlock Block to be executed when receiving data
- */
-- (void)setDelegate:(void(^)(NSData *frameData))bufferBlock
-{
- _onBuffered = bufferBlock;
-}
-
-/**
- * Specified initializer
- * @param request HTTP request
- * @return Instance
- */
-- (id)initWithRequest:(NSMutableURLRequest*)request
-{
- if (self = [super init]) {
- _request = request;
- _buffer = [NSMutableData data];
- _frameArray = [NSMutableArray array];
- _isContinue = NO;
- }
- return self;
-}
-
-/**
- * Start data acquisition
- * @param sessionId Session ID
- */
-- (void)getData:(NSString*)sessionId
-{
- if (!_isContinue) {
- // Create JSON data
- NSDictionary *body = @{@"name": @"camera._getLivePreview",
- @"parameters":
- @{@"sessionId": sessionId}};
-
- // Set the request-body.
- [self->_request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
-
- NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
- NSURLSession* session = [NSURLSession sessionWithConfiguration:config
- delegate:self
- delegateQueue:[NSOperationQueue mainQueue]];
-
- // Start data acquisition task
- _task = [session dataTaskWithRequest:_request];
- [_task resume];
- _isContinue = YES;
- }
-}
-
-/**
- * Stop data acquisition task
- */
-- (void)cancel
-{
- [_task cancel];
-}
-
-/**
- * Delegate for notification that part of the data has been received by the data acquisition task
- * @param session Session
- * @param dataTask Task
- * @param data Received data
- */
-- (void)URLSession:(NSURLSession *)session
- dataTask:(NSURLSessionDataTask *)dataTask
- didReceiveData:(NSData *)data
-{
- [_buffer appendData:data];
- Byte b1[2];
-
- // Search for SOI marker position from buffer
- NSUInteger soi;
- NSUInteger eoi;
- do {
- soi = 0;
- eoi = 0;
- NSInteger i = 0;
-
- for (; i < (NSInteger)_buffer.length - 1; i++) {
- [_buffer getBytes:b1 range:NSMakeRange(i, 2)];
- if (SOI_MARKER[0] == b1[0]) {
- if (SOI_MARKER[1] == b1[1]) {
- soi = i;
- break;
- }
- }
- }
-
- for (; i < (NSInteger)_buffer.length - 1; i++) {
- [_buffer getBytes:b1 range:NSMakeRange(i, 2)];
- if (EOI_MARKER[0] == b1[0]) {
- if (EOI_MARKER[1] == b1[1]) {
- eoi = i;
- break;
- }
- }
- }
-
- // Exit process if EOI not found
- if (eoi == 0) {
- return;
- }
- NSData *frameData = [_buffer subdataWithRange:NSMakeRange(soi, eoi - soi)];
-
- // Draw
- _onBuffered(frameData);
-
- // Delete used parts of data
- NSUInteger remainLength = _buffer.length - eoi - 2;
- Byte remain[remainLength];
- [_buffer getBytes:remain range:NSMakeRange(eoi + 2, remainLength)];
- _buffer = [NSMutableData dataWithBytes:remain length:remainLength];
- } while (0 < eoi);
-}
-
-/**
- * Delegate for notification that the data task has finished receiving data
- * @param session Session
- * @param task Task
- * @param error Error information
- */
-- (void)URLSession:(NSURLSession *)session
- task:(NSURLSessionTask *)task
-didCompleteWithError:(NSError *)error
-{
- // Called when session expires
- [session invalidateAndCancel];
- _isContinue = NO;
- NSLog(@"HttpStream didCompleteWithError: %@", error);
-}
-
-@end
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import "HttpStream.h"
+
+// Start and end markers for images in JPEG format
+const Byte SOI_MARKER[] = {0xFF, 0xD8};
+const Byte EOI_MARKER[] = {0xFF, 0xD9};
+
+/**
+ * Live view data acquisition class
+ */
+@interface HttpStream()
+{
+ NSMutableURLRequest *_request;
+ NSMutableData *_buffer;
+ NSMutableArray *_frameArray;
+ NSURLSessionDataTask *_task;
+ void (^_onBuffered)(NSData *frameData);
+ BOOL _isContinue;
+}
+@end
+
+@implementation HttpStream
+
+/**
+ * Set block to be executed when receiving data
+ * @param bufferBlock Block to be executed when receiving data
+ */
+- (void)setDelegate:(void(^)(NSData *frameData))bufferBlock
+{
+ _onBuffered = bufferBlock;
+}
+
+/**
+ * Specified initializer
+ * @param request HTTP request
+ * @return Instance
+ */
+- (id)initWithRequest:(NSMutableURLRequest*)request
+{
+ if (self = [super init]) {
+ _request = request;
+ _buffer = [NSMutableData data];
+ _frameArray = [NSMutableArray array];
+ _isContinue = NO;
+ }
+ return self;
+}
+
+/**
+ * Start data acquisition
+ * @param sessionId Session ID
+ */
+- (void)getData:(NSString*)sessionId
+{
+ if (!_isContinue) {
+ // Create JSON data
+ NSDictionary *body = @{@"name": @"camera._getLivePreview",
+ @"parameters":
+ @{@"sessionId": sessionId}};
+
+ // Set the request-body.
+ [self->_request setHTTPBody:[NSJSONSerialization dataWithJSONObject:body options:0 error:nil]];
+
+ NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
+ NSURLSession* session = [NSURLSession sessionWithConfiguration:config
+ delegate:self
+ delegateQueue:[NSOperationQueue mainQueue]];
+
+ // Start data acquisition task
+ _task = [session dataTaskWithRequest:_request];
+ [_task resume];
+ _isContinue = YES;
+ }
+}
+
+/**
+ * Stop data acquisition task
+ */
+- (void)cancel
+{
+ [_task cancel];
+}
+
+/**
+ * Delegate for notification that part of the data has been received by the data acquisition task
+ * @param session Session
+ * @param dataTask Task
+ * @param data Received data
+ */
+- (void)URLSession:(NSURLSession *)session
+ dataTask:(NSURLSessionDataTask *)dataTask
+ didReceiveData:(NSData *)data
+{
+ [_buffer appendData:data];
+ Byte b1[2];
+
+ // Search for SOI marker position from buffer
+ NSUInteger soi;
+ NSUInteger eoi;
+ do {
+ soi = 0;
+ eoi = 0;
+ NSInteger i = 0;
+
+ for (; i < (NSInteger)_buffer.length - 1; i++) {
+ [_buffer getBytes:b1 range:NSMakeRange(i, 2)];
+ if (SOI_MARKER[0] == b1[0]) {
+ if (SOI_MARKER[1] == b1[1]) {
+ soi = i;
+ break;
+ }
+ }
+ }
+
+ for (; i < (NSInteger)_buffer.length - 1; i++) {
+ [_buffer getBytes:b1 range:NSMakeRange(i, 2)];
+ if (EOI_MARKER[0] == b1[0]) {
+ if (EOI_MARKER[1] == b1[1]) {
+ eoi = i;
+ break;
+ }
+ }
+ }
+
+ // Exit process if EOI not found
+ if (eoi == 0) {
+ return;
+ }
+ NSData *frameData = [_buffer subdataWithRange:NSMakeRange(soi, eoi - soi)];
+
+ // Draw
+ _onBuffered(frameData);
+
+ // Delete used parts of data
+ NSUInteger remainLength = _buffer.length - eoi - 2;
+ Byte remain[remainLength];
+ [_buffer getBytes:remain range:NSMakeRange(eoi + 2, remainLength)];
+ _buffer = [NSMutableData dataWithBytes:remain length:remainLength];
+ } while (0 < eoi);
+}
+
+/**
+ * Delegate for notification that the data task has finished receiving data
+ * @param session Session
+ * @param task Task
+ * @param error Error information
+ */
+- (void)URLSession:(NSURLSession *)session
+ task:(NSURLSessionTask *)task
+didCompleteWithError:(NSError *)error
+{
+ // Called when session expires
+ [session invalidateAndCancel];
+ _isContinue = NO;
+ NSLog(@"HttpStream didCompleteWithError: %@", error);
+}
+
+@end
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/main.m b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/main.m
index 78d4b63..16ddbf4 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/main.m
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/main.m
@@ -1,14 +1,14 @@
-/*
- * Copyright Ricoh Company, Ltd. All rights reserved.
- */
-
-#import
-
-#import "AppDelegate.h"
-
-int main(int argc, char *argv[])
-{
- @autoreleasepool {
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
- }
-}
+/*
+ * Copyright Ricoh Company, Ltd. All rights reserved.
+ */
+
+#import
+
+#import "AppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
diff --git a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2-Info.plist b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2-Info.plist
index 9075057..552a76c 100755
--- a/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2-Info.plist
+++ b/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2/ricoh-theta-sample-for-iosv2-Info.plist
@@ -1,43 +1,43 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleDisplayName
- ${PRODUCT_NAME}
- CFBundleExecutable
- ${EXECUTABLE_NAME}
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- ${PRODUCT_NAME}
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- 0.1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 0.1.0
- LSRequiresIPhoneOS
-
- NSAppTransportSecurity
-
- NSAllowsArbitraryLoads
-
-
- UIMainStoryboardFile
- MainStoryboard
- UIRequiredDeviceCapabilities
-
- armv7
-
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
-
-
-
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleDisplayName
+ ${PRODUCT_NAME}
+ CFBundleExecutable
+ ${EXECUTABLE_NAME}
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ ${PRODUCT_NAME}
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 0.1.1
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 0.1.1
+ LSRequiresIPhoneOS
+
+ NSAppTransportSecurity
+
+ NSAllowsArbitraryLoads
+
+
+ UIMainStoryboardFile
+ MainStoryboard
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+
+
+